[vdr] cTS2PES::write_ipack infinite recursion

Reinhard Nissl rnissl at gmx.de
Wed Dec 17 01:33:55 CET 2008


Hi,

Reinhard Nissl schrieb:

>>> Is there a regular chance for you to reproduce this issue?
>>>
>>> I could send you a code fragment then which would store a
>>> reasonably sized fragment of the TS stream which would help me
>>> very much in solving this issue.
>> It hasn't happened again yet, and I don't think the chance is high that 
>> it will occur again, even during bad reception...
>> I have extracted the TS data that was passed to cRemux::Put from the 
>> coredump though (24440 bytes, I'll send it to you in a separate, private 
>> mail).
> 
> Thanks for your efforts so far.
> 
>> When I just feed this data to a pristine cRemux instance ('cRemux *remux 
>> = new cRemux(1023, 0, 0, 0, true); remux->Put(data, sizeof data);'), it 
>> doesn't trigger the bug however, so it depends on some state generated 
>> by earlier packets I probably can't access anymore.
>> When I hack cTS2PES::ts_to_pes to always set "done=true;" at the start 
>> of the function, write_ipack recurses in a similar fashion, though...
>> Maybe that helps... if you need earlier TS packets, maybe I could try to 
>> dump them from the ringbuffer...
> 
> I would be glad if you could extract that data too ;-)

Please find attached the patch (should be compatible with 1.6.x
and 1.7.0) which fixes this issue.

The problem was, that "done" was set to true but not reset with
the next PES packet. Typically this is done when found reaches
plength + 6, or when found was at least 6. But in this case,
found was just 4 as the PES packet started near the end of an TS
packet. Then some TS packets were missing and the next one
started a new PES packet. But only found was reset to 0 while
done got stuck at true. Later on, this caused write_ipack() calls
with mpeg still being 0. In this case, send_ipack() didn't reset
count so that the recursive call to write_ipack() parsed ancient
data, leading to incorrect breakAt locations which made bite
negative. As a result, the recursive calls stepped forward and
backward on the same data forever.

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remux_fix.diff
Type: text/x-patch
Size: 434 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/vdr/attachments/20081217/de06e2c1/attachment.bin 


More information about the vdr mailing list