[FFmpeg-devel] RV10 extradata size check

Benoit Fouet benoit.fouet
Tue Dec 16 00:02:24 CET 2008


Michael Niedermayer wrote :
> On Mon, Dec 15, 2008 at 09:03:26PM +0100, Laurent Aimar wrote:
>   
>> 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).
>>     
>
> hmm, maybe these are unneeded ...
>
>
>   
>> I have attached another patch without the check on extradata pointer.
>>     
>
> looks ok
>
> [...]
>   
>   

applied

Ben





More information about the ffmpeg-devel mailing list