[FFmpeg-devel] RV10 extradata size check

Michael Niedermayer michaelni
Mon Dec 15 20:49:04 CET 2008


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.
> 
> -- 
> fenrir
> 

> 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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/43a2507d/attachment.pgp>



More information about the ffmpeg-devel mailing list