[FFmpeg-devel] [PATCH] Add missing input buffer padding to h264/mkv

Alexander Strange astrange
Thu Dec 18 23:21:40 CET 2008


This fixes the large number of valgrind warnings I get printed  
decoding h264+mkv, by adding input buffer padding where the bitstream  
readers need it. No speed change.

==54385== Conditional jump or move depends on uninitialised value(s)
==54385==    at 0x28F701: get_cabac_terminate+37 (in ./ffmpeg_g)
==54385==    by 0x2C7CA6: decode_slice+722 (in ./ffmpeg_g)
==54385==    by 0x2C8B8D: execute_decode_slices+44 (in ./ffmpeg_g)
==54385==    by 0x2C942C: decode_nal_units+1917 (in ./ffmpeg_g)
==54385==    by 0x2CACE9: decode_frame+971 (in ./ffmpeg_g)
==54385==    by 0xD0E84: avcodec_decode_video+216 (in ./ffmpeg_g)
==54385==    by 0x5A33: +212 (in ./ffmpeg_g)
==54385==    by 0x93A0: +2177 (in ./ffmpeg_g)
==54385==    by 0xDB76: main+434 (in ./ffmpeg_g)
==54385==  Uninitialised value was created by a heap allocation
==54385==    at 0x8BDE53: malloc+99 (in /usr/local/lib/valgrind/x86- 
darwin/vgpreload_memcheck.so)
==54385==    by 0x8C0041: realloc+257 (in /usr/local/lib/valgrind/x86- 
darwin/vgpreload_memcheck.so)
==54385==    by 0x4019B6: av_realloc+41 (in ./ffmpeg_g)
==54385==    by 0xCFBCA: av_fast_realloc+72 (in ./ffmpeg_g)
==54385==    by 0x29464C: decode_nal+303 (in ./ffmpeg_g)
==54385==    by 0x2C8E77: decode_nal_units+456 (in ./ffmpeg_g)
==54385==    by 0x2CACE9: decode_frame+971 (in ./ffmpeg_g)
==54385==    by 0xD0E84: avcodec_decode_video+216 (in ./ffmpeg_g)
==54385==    by 0x5A33: +212 (in ./ffmpeg_g)
==54385==    by 0x93A0: +2177 (in ./ffmpeg_g)
==54385==    by 0xDB76: main+434 (in ./ffmpeg_g)

==54385== Invalid read of size 1
==54385==    at 0x29DAFD: get_se_golomb+118 (in ./ffmpeg_g)
==54385==    by 0x2CA6C1: decode_picture_parameter_set+908 (in ./ 
ffmpeg_g)
==54385==    by 0x2C93DA: decode_nal_units+1835 (in ./ffmpeg_g)
==54385==    by 0x2CABFA: decode_frame+732 (in ./ffmpeg_g)
==54385==    by 0xD0E84: avcodec_decode_video+216 (in ./ffmpeg_g)
==54385==    by 0x5A33: +212 (in ./ffmpeg_g)
==54385==    by 0x93A0: +2177 (in ./ffmpeg_g)
==54385==    by 0xDB76: main+434 (in ./ffmpeg_g)
==54385==  Address 0xb3104b is 2 bytes after a block of size 41 alloc'd
==54385==    at 0x8BDE53: malloc+99 (in /usr/local/lib/valgrind/x86- 
darwin/vgpreload_memcheck.so)
==54385==    by 0x40197E: av_malloc+34 (in ./ffmpeg_g)
==54385==    by 0x50189: matroska_read_header+4895 (in ./ffmpeg_g)
==54385==    by 0x11B66: av_open_input_stream+287 (in ./ffmpeg_g)
==54385==    by 0x11E8C: av_open_input_file+583 (in ./ffmpeg_g)
==54385==    by 0xAD82: +165 (in ./ffmpeg_g)
==54385==    by 0xE1F8: parse_options+737 (in ./ffmpeg_g)
==54385==    by 0xDAB5: main+241 (in ./ffmpeg_g)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264-mkv-zeropadding.diff
Type: text/x-diff
Size: 1583 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081218/347e1302/attachment.diff>
-------------- next part --------------




More information about the ffmpeg-devel mailing list