Update contrib to improve ffmpeg resilience when decoding h264 stream with missing reference pics
Linux client:
vlc: h264.c:2313: mc_dir_part: Assertion `pic->data[0]' failed
Win32 client:
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 3340.0x20c]
0x006cd418 in put_h264_qpel16_mc00_mmx2 (
dst=0x1b1c8210 "\021\021\021\021", '\020' <repeats 196 times>...,
src=0x0, stride=544) at i386/dsputil_mmx.c:416
416 i386/dsputil_mmx.c: No such file or directory.
in i386/dsputil_mmx.c
(gdb) bt
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x006cd418 in put_h264_qpel16_mc00_mmx2 (
dst=0x1b1c8210 "\021\021\021\021", '\020' <repeats 196 times>...,
src=0x0, stride=544) at i386/dsputil_mmx.c:416
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x007cd2ea in mc_dir_part (h=0x26fc670, pic=0x270e558, n=0, square=1,
chroma_height=8, delta=0, list=0,
dest_y=0x1b1c8210 "\021\021\021\021", '\020' <repeats 196 times>...,
dest_cb=0x1b225898 '\200' <repeats 200 times>...,
dest_cr=0x1b2335d8 '\200' <repeats 200 times>..., src_x_offset=0,
src_y_offset=0, qpix_op=0x26fd3f0,
chroma_op=0x6d6b60 <put_h264_chroma_mc8_mmx>) at h264.c:2596
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0x007c577b in hl_motion (h=0x26fc670,
dest_y=0x1b1c8210 "\021\021\021\021", '\020' <repeats 196 times>...,
dest_cb=0x1b225898 '\200' <repeats 200 times>...,
dest_cr=0x1b2335d8 '\200' <repeats 200 times>..., qpix_put=0x26fd3f0,
chroma_put=0x26fd3d8, qpix_avg=0x26fd4b0, chroma_avg=0x26fd3e4,
weight_op=0x26fd570, weight_avg=0x26fd598) at h264.c:2634
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x007bf062 in hl_decode_mb (h=0x26fc670) at h264.c:3369
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0x007ca173 in decode_slice (h=0x26fc670) at h264.c:6696
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x007bf640 in decode_nal_units (h=0x26fc670, buf=0x1b2d6f10 "",
buf_size=1907) at h264.c:7370
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x007bca76 in decode_frame (avctx=0x26fb8d0, data=0x2749df0,
data_size=0x1b78fed8, buf=0x1b2d6f10 "", buf_size=1907) at h264.c:7510
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) 0x00635436 in avcodec_decode_video (avctx=0x26fb8d0, picture=0x2749df0,
got_picture_ptr=0x1b78fed8, buf=0x1b2d6f10 "", buf_size=1907)
at utils.c:625
[#8](https://code.videolan.org/videolan/vlc/-/issues/8) 0x0049c3c5 in DecodeVideo__ffmpeg (p_dec=0x26f9748, pp_block=0x1b78ff54)
at video.c:504
[#9](https://code.videolan.org/videolan/vlc/-/issues/9) 0x0046796b in DecoderDecode (p_dec=0x26f9748, p_block=0x1b21d460)
at src/input/decoder.c:721
[#10](https://code.videolan.org/videolan/vlc/-/issues/10) 0x00467f09 in DecoderThread (p_dec=0x26f9748) at src/input/decoder.c:488
[#11](https://code.videolan.org/videolan/vlc/-/issues/11) 0x77bcb530 in msvcrt!_endthreadex ()
from /cygdrive/c/WINDOWS/system32/msvcrt.dll
[#12](https://code.videolan.org/videolan/vlc/-/issues/12) 0x026f9748 in ?? ()
[#13](https://code.videolan.org/videolan/vlc/-/issues/13) 0x00000000 in ?? () from
Crash happens at random intervals on mmsh/asfh h264/mp3 livestream. Typically when client bitrate isn't sufficient (and/or retransmits occur). Tested with svn-20060109 (same problem with mplayer-CVS-050928).
Points to ffmpeg decoding issue with unaligned acces on a SSE2 CPU. With same SSE2 load instruction it must be aligned to 16 bytes, if not it crashes (so data alignment is not right here?).
Corruption in the decoder stream triggers corner cases in ffmpeg which have nog been taken into account yet?
The assertion error indicates a non-existant frame was used for motion compensation (mc_dir_part).
Another crash sample occurance which seems to relate to the same problem:
ffmpeg warning: reference picture missing during reorder (h264@012E52C0)
The ffmpeg decoder (cvs-20060109) seems unable to recover from missing reference frames (which can for instance be caused by unreliable internet streaming) and it crashes...
Update 20060221: some error resilience has already been added to ffmpeg cvs, contrib needs updating