[Ffmpeg-devel] h264 playback crash

Loren Merritt lorenm
Sat May 6 19:18:35 CEST 2006

On Fri, 5 May 2006, grenola wrote:

> Hi there,
> I have recently become aware of a bug in ffmpeg's h264 decoding routines. The 
> bug is seemingly triggered when one piece of h264 is appended to another 
> piece of h264 and the resulting output file fed to ffmpeg. The bug has been 
> tested using appended samples created both using avidemux and VirtualDub, and 
> the result is the same. The bug also affects playback using vlc and mplayer.
> The following gdb trace was derived using a CVS snapshot from the 5th of May 
> 2006. There follows a similar dump created using mplayer (compiled against 
> the same ffmpeg CVS snapshot) which shows the bug a bit more clearly (in 
> particular see the very end of this email).
> Any workarounds (i.e. a way to append 264 video files that does not result in 
> this bug being triggered) would be very helpful.
> You may download a crashing testcase here:
> http://www.ali1548.ukshells.co.uk/loller.avi

The problem: you concatenated two files with different settings, but 
storing those settings in the same SPS/PPS ids. This is strictly legal by 
H.264 standard, but can't be expected to work in all containers.
I have fixed your particular video in ffh264, but some others will 
probably still break.
The recommended way to do it is using x264's --sps-id. It should also be 
possible to change the sps id of an already encoded file, but I don't 
know any tool to do so.

--Loren Merritt

More information about the ffmpeg-devel mailing list