[Ffmpeg-devel] h264: fix bit_length calculation for dst_length == 0

Reinhard Nissl rnissl
Mon Apr 9 13:21:58 CEST 2007


when dst_length == 0 it's obvious that bit_length has to be 0 too.

But the current code still calls decode_rbsp_trailing() and therefore
bit_length might get negative.

Although the remaining code is able to handle a negative bit_length, I
think it is better to avoid the calculation at all by setting bit_length
to 0 for dst_length == 0. The attached patch fixes this issue.

Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-h264-fix-bit-length-calculation.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070409/e14401c7/attachment.bin>

More information about the ffmpeg-devel mailing list