[FFmpeg-devel] RV10 extradata size check

Laurent Aimar fenrir
Mon Dec 15 21:03:26 CET 2008


Hi,

On Mon, Dec 15, 2008, Michael Niedermayer wrote:
> On Mon, Dec 15, 2008 at 08:18:55PM +0100, Laurent Aimar wrote:
> >  The attached patch prevents a segfault in rv10/20 decoder in case too
> > short or missing extradata is given to libavcodec.
> > Index: rv10.c
> > ===================================================================
> > --- rv10.c	(revision 16119)
> > +++ rv10.c	(working copy)
> > @@ -527,6 +527,11 @@
> >      MpegEncContext *s = avctx->priv_data;
> >      static int done=0;
> >  
> > +    if (avctx->extradata_size < 8 || !avctx->extradata) {
> > +        av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
> > +        return -1;
> > +    }
> 
> the extradata / NULL check seems redundant
 It is done this way in some other decoders (like vc1, h264).
I have attached another patch without the check on extradata pointer.

-- 
fenrir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rv10-extradata-check.patch
Type: text/x-diff
Size: 413 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/633eef8b/attachment.patch>



More information about the ffmpeg-devel mailing list