[FFmpeg-devel] [PATCH] IFF: Check for invalid width and height in decoder

Stefano Sabatini stefano.sabatini-lala
Mon May 10 01:09:23 CEST 2010


On date Monday 2010-05-10 00:56:12 +0200, Sebastian Vater encoded:
> Stefano Sabatini a ?crit :
> > not supported -> invalid
> >   
> 
> Fixed && patch attached!
> 
> -- 
> 
> Best regards,
>                    :-) Basty/CDGS (-:
> 

> diff --git a/libavcodec/iff.c b/libavcodec/iff.c
> index c911811..037322d 100644
> --- a/libavcodec/iff.c
> +++ b/libavcodec/iff.c
> @@ -115,6 +113,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
>          return AVERROR_INVALIDDATA;
>      }
>  
> +    if (avctx->width <= 0 || avctx->height <= 0) {
> +        av_log(avctx, AV_LOG_ERROR, "width and height <= 0 are invalid\n");

width *or* height, also it's always nice to show the actual invalid
values, check how avcodec_check_dimensions() does it.

Regards.
-- 
FFmpeg = Free and Friendly Mind-dumbing Pacific Empowered Game



More information about the ffmpeg-devel mailing list