[MPlayer-dev-eng] [PATCH] -demuxer lavf and svq3 mov files

Michael Niedermayer michaelni at gmx.at
Mon Jul 31 01:50:25 CEST 2006


Hi

On Sun, Jul 30, 2006 at 06:26:48PM -0400, Alan Curry wrote:
> mplayer -demuxer lavf crashes on SVQ3 mov's. This is caused by confusion over
> where the extradata is supposed to be stored. vd_ffmpeg expects extradata to
> be in sh_video->ImageDesc if the codec is SVQ3. That's where demux_mov puts
> it. demux_lavf puts the extradata at the end of the BITMAPINFOHEADER
> regardless of the codec.
> 
> svq3.c parses the extradata with some sloppy code that doesn't check for NULL
> pointers or buffer sizes, causing the crash.
> 
> There are a couple of ways to get the extradata where it needs to be: fix
> demux_lavf to do what demux_mov does (making a new special case for the SVQ3
> codec), or fix vd_ffmpeg to look in both places (easier since it already has
> a SVQ3 special case).
> 
> The sample file mentioned in the comment at the top of libavcodec/svq3.c:
> 
>   ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
> 
> provides a good test case for this patch. With the current codec, it crashes
> mplayer -demuxer lavf. If you just apply a minimal fix to svq3.c to prevent
> the NULL pointer dereference, it doesn't crash but doesn't decode correctly
> either because it really needs to see the extradata. With the following patch,
> it plays correctly.
> 
> The patch is in 2 parts. The first part is a bug fix that I think should be
> worthwhile on its own, but I don't have any affected files (AVRn? Pegasus
> MJPEG?) to test it with. Adding sizeof(BITMAPINFOHEADER) to something that's
> already a BITMAPINFOHEADER * just can't be right...
> 
> The second part moves the SVQ3 case up in the switch so it can fallthrough to
> the BITMAPINFOHEADER code when ImageDesc is NULL.
> 
> And - bonus! - I just noticed that vd_qtvideo already has something similar:
>     if(!sh->ImageDesc) sh->ImageDesc=(sh->bih+1); // hack for SVQ3-in-AVI
> which makes me even more confident that this is a good solution.

both patches look ok
[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list