here is the git patch.<div>thanks</div><div>Angelo<br><br><div class="gmail_quote">2013/1/23 Jean-Paul Saman <span dir="ltr"><<a href="mailto:jpsaman@videolan.org" target="_blank">jpsaman@videolan.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Angelo,<br><br>Could you please sent a patch against git://<a href="http://git.videolan.org/libdvbpsi.git" target="_blank">git.videolan.org/libdvbpsi.git</a> repository using the git tool?<br>
</div><div><br>It makes reviewing your changes easier.<br>
</div><div><br></div>Thank you very much.<br><br></div>Kind regards,<br>Jean-Paul Saman<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jan 22, 2013 at 5:03 PM, Angelo Schiavone <span dir="ltr"><<a href="mailto:angelo.schiavone@gmail.com" target="_blank">angelo.schiavone@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>Hi again, TOT table does not decode correctly, it miss descriptors in the descriptors loop.</div>
<div>That's because <span style="color:rgb(192,192,192)">            </span>p_byte<span style="color:rgb(192,192,192)"> </span>+=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">7</span>; is incremented after p_end is calculated</div>


<div><pre style="margin-top:0px;margin-bottom:0px">p_end<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>p_byte<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)">   </span>((uint16_t)(p_section->p_payload_start[<span style="color:rgb(0,0,128)">5</span>]<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0x0f</span>)<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">8</span>)</pre>


<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                                 </span>|<span style="color:rgb(192,192,192)"> </span>p_section->p_payload_start[<span style="color:rgb(0,0,128)">6</span>]);</pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Instead it should happen before p_end assignment, attached the correct version.</span></pre>


<pre style="margin-top:0px;margin-bottom:0px"><br></pre></div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span>dvbpsi_tot_sections_decode(<span style="color:#800080">dvbpsi_t</span>*<span style="color:#c0c0c0"> </span>p_dvbpsi,<span style="color:#c0c0c0"> </span><span style="color:#800080">dvbpsi_tot_t</span>*<span style="color:#c0c0c0"> </span>p_tot,</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                              </span><span style="color:#800080">dvbpsi_psi_section_t</span>*<span style="color:#c0c0c0"> </span>p_section)</pre>
<pre style="margin-top:0px;margin-bottom:0px">{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span>(p_section)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>uint8_t*<span style="color:#c0c0c0"> </span>p_byte;</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span>(!dvbpsi_tot_section_valid(p_dvbpsi,<span style="color:#c0c0c0"> </span>p_section))</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span><span style="color:#808000">return</span>;</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>p_byte<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>p_section->p_payload_start;</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span>(p_byte<span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span><span style="color:#000080">5</span><span style="color:#c0c0c0"> </span><=<span style="color:#c0c0c0"> </span>p_section->p_payload_end)</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>p_tot-><span style="color:#800000">i_utc_time</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>((uint64_t)p_byte[<span style="color:#000080">0</span>]<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#000080">32</span>)<span style="color:#c0c0c0"> </span>|</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                                </span>((uint64_t)p_byte[<span style="color:#000080">1</span>]<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#000080">24</span>)<span style="color:#c0c0c0"> </span>|</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                                </span>((uint64_t)p_byte[<span style="color:#000080">2</span>]<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#000080">16</span>)<span style="color:#c0c0c0"> </span>|</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                                </span>((uint64_t)p_byte[<span style="color:#000080">3</span>]<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#000080">8</span>)<span style="color:#c0c0c0"> </span>|</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                                 </span>(uint64_t)p_byte[<span style="color:#000080">4</span>];</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#008000">/*</span><span style="color:#c0c0c0"> </span><span style="color:#008000">If</span><span style="color:#c0c0c0"> </span><span style="color:#008000">we</span><span style="color:#c0c0c0"> </span><span style="color:#008000">have</span><span style="color:#c0c0c0"> </span><span style="color:#008000">a</span><span style="color:#c0c0c0"> </span><span style="color:#008000">TOT,</span><span style="color:#c0c0c0"> </span><span style="color:#008000">extract</span><span style="color:#c0c0c0"> </span><span style="color:#008000">the</span><span style="color:#c0c0c0"> </span><span style="color:#008000">descriptors</span><span style="color:#c0c0c0"> </span><span style="color:#008000">*/</span></pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span>(p_section->i_table_id<span style="color:#c0c0c0"> </span>==<span style="color:#c0c0c0"> </span><span style="color:#000080">0x73</span>)</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>uint8_t*<span style="color:#c0c0c0"> </span>p_end;</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>p_byte<span style="color:#c0c0c0"> </span>+=<span style="color:#c0c0c0"> </span><span style="color:#000080">7</span>;</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>p_end<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>p_byte<span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span>(<span style="color:#c0c0c0">   </span>((uint16_t)(p_section->p_payload_start[<span style="color:#000080">5</span>]<span style="color:#c0c0c0"> </span>&<span style="color:#c0c0c0"> </span><span style="color:#000080">0x0f</span>)<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#000080">8</span>)</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                                 </span>|<span style="color:#c0c0c0"> </span>p_section->p_payload_start[<span style="color:#000080">6</span>]);</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span><span style="color:#808000">while</span><span style="color:#c0c0c0"> </span>(p_byte+<span style="color:#000080">2</span><span style="color:#c0c0c0"> </span><=<span style="color:#c0c0c0"> </span>p_end)</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                </span>uint8_t<span style="color:#c0c0c0"> </span>i_tag<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>p_byte[<span style="color:#000080">0</span>];</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                </span>uint8_t<span style="color:#c0c0c0"> </span>i_length<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>p_byte[<span style="color:#000080">1</span>];</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span>(i_length<span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span><span style="color:#000080">2</span><span style="color:#c0c0c0"> </span><=<span style="color:#c0c0c0"> </span>p_section->p_payload_end<span style="color:#c0c0c0"> </span>-<span style="color:#c0c0c0"> </span>p_byte)</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                    </span>dvbpsi_tot_descriptor_add(p_tot,<span style="color:#c0c0c0"> </span>i_tag,<span style="color:#c0c0c0"> </span>i_length,<span style="color:#c0c0c0"> </span>p_byte<span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span><span style="color:#000080">2</span>);</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">                </span>p_byte<span style="color:#c0c0c0"> </span>+=<span style="color:#c0c0c0"> </span><span style="color:#000080">2</span><span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span>i_length;</pre>



<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px">}</pre>
<br></div></div>_______________________________________________<br>
libdvbpsi-devel mailing list<br>
<a href="mailto:libdvbpsi-devel@videolan.org" target="_blank">libdvbpsi-devel@videolan.org</a><br>
<a href="http://mailman.videolan.org/listinfo/libdvbpsi-devel" target="_blank">http://mailman.videolan.org/listinfo/libdvbpsi-devel</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>