[PATCH] [Ffmpeg-devel] avi graphic problem

John Koleszar jkoleszar
Fri Mar 3 22:11:14 CET 2006

Diego Biurrun wrote:

>On Fri, Mar 03, 2006 at 02:28:12PM -0500, DKorchev at aol.com wrote:
>>I found a problem with graphic AVI files, the first two crash ffmpeg,  the 
>>other three get transcoded incorrectly.
>The crash does not occur with MPlayer's native demuxer, so it's probably
>a bug in the AVI demuxer.
Took a quick look at this, and it looks like the problem is that the 
lavc raw decoder doesn't support 8bpp bitmaps (only tested blur.avi). 
This causes the codec's init() to fail, as expected. It's private data 
is then freed. However, the reference to this codec is kept around. 
Essentially, the codec gets partially initialized by avcodec_open()'d 
but doesn't get completely uninitialized because it doesn't get 
avcodec_close()'d because the open failed.

Clear as mud.

Anyway, attached patch is one way to fix it.. Seems most correct to me 
because it is most like avcodec_close(). Of course, it probably wouldn't 
hurt to put guards in raw.c to avoid derefrencing null priv_data, but it 
seems to me to be a bug that raw_decode() is called at all if 
raw_decode_init() fails...

Patch attached..


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: avcodec_open_failure.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060303/33a9f29e/attachment.asc>

More information about the ffmpeg-devel mailing list