[Ffmpeg-devel] [PATCH] Fix crush when truncated slice passed to H.264 decoder

Michael Niedermayer michaelni
Tue Dec 5 21:08:23 CET 2006


On Tue, Dec 05, 2006 at 09:26:38PM +0300, Alexander Chemeris wrote:
> Hello all,
> This patch corrects FFMpeg's behaviour in case where H.264 slice
> come to decoder truncated. This may occure when you receive
> video stream from net and could not use big buffer on input to conceal
> network jitter. It is common case for video telephony over Internet.
> At svn rev 7225 FFMpeg often crashes when you pass incomplete slice
> to decoder. You could reproduce this with attached H.264 frame and
> ffmpeg executable:
> % ffmpeg -f h264 -i crash.h264
> The cause of this crash is decoder continue reading from stream, even
> if no more data is available. In this case get_vlc2() seems to return -1,
> so I add sheck for negative return result when total_coeff is read from 
> stream.
> It would be better to check every return result, but this will slow
> down decoding.
> Though some other values are checked, and it seems frequent crashes go
> away with this fix. If more crashes will arise on bigger array of
> tests, I'll report
> them.

patch looks ok

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali

More information about the ffmpeg-devel mailing list