[Ffmpeg-devel] r7794 broke roqvideo

Aurelien Jacobs aurel
Tue Feb 20 23:42:28 CET 2007


On Tue, 20 Feb 2007 17:32:33 +0100
Michel Bardiaux <mbardiaux at mediaxim.be> wrote:

> Diego Biurrun wrote:
> > Hi,
> > 
> > r7794 broke roqvideo:
> > 
> > ------------------------------------------------------------------------
> > r7794 | takis | 2007-02-01 10:45:05 +0100 (Thu, 01 Feb 2007) | 3 lines
> > Changed paths:
> >    M /trunk/libavcodec/utils.c
> > 
> > Activate guards in avcodec_default_get_buffer. Patch by Michel Bardiaux,
> > mbardiaux mediaxim dot be.
> > ------------------------------------------------------------------------
> > 
> > Try playing any sample from
> > 
> > http://samples.mplayerhq.hu/game-formats/idroq/
> > 
> > and you will get a lot of
> > 
> > [roqvideo @ 0x83cb740]pic->data[0]!=NULL in avcodec_default_get_buffer
> > [roqvideo @ 0x83cb740]  RoQ: get_buffer() failed
> > 
> > and no video.
> > 
> > Diego
> 
> What I did was replace 2 assert(), which were not checked in vanilla 
> builds, by if(). The 2nd was relevant, since it led to the realization 
> the release_buffer was missing in some image codecs. I had no way to 
> discoverr the 1st assert(pic->data[0]==NULL) was wrong in some rare 
> cases (after all regression test passed). That's a job for someone who 
> really understands all the subtleties of buffer get/release.

The attached patch fix this issue.
But I wonder if the check is really wise at first (in get_buffer):

if(pic->data[0]!=NULL) {
    av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n");
    return -1;
}

I think this test should simply be removed. There is no reason to
force get_buffer() caller to set pic->data[0] to NULL before calling it.
We have already vp5/vp6 and roq which got hit by this issue but there
may be other obscure codecs which are affected and wasn't tested since
then.
Would anyone care if I remove this test ?

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: roq-fix.diff
Type: text/x-diff
Size: 428 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070220/d7b3616f/attachment.diff>



More information about the ffmpeg-devel mailing list