[FFmpeg-devel] [PATCH] IFF: Check for invalid width and height in decoder
Stefano Sabatini
stefano.sabatini-lala
Tue May 11 00:00:05 CEST 2010
On date Monday 2010-05-10 15:48:34 +0200, Sebastian Vater encoded:
> Ronald S. Bultje a ?crit :
> > Hi,
> >
> > On Mon, May 10, 2010 at 9:39 AM, Sebastian Vater
> > <cdgs.basty at googlemail.com> wrote:
> >
> >> Ronald S. Bultje a ?crit :
> >>
> >>> Why don't you use avcodec_check_dimensions()?
> >>>
> >> Because it doesn't check for == 0, which I have to...also
> >> avcodec_check_dimensions prints them unsigned.
> >>
> >
> > int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
> > if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
> > return 0;
> >
> > av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
> > return AVERROR(EINVAL);
> > }
> >
> > What am I missing?
> >
>
> Strange...somebody told me yesterday that it won't check for 0.
Ehm... it was me. First rule is, never trust me, especially after 1
a.m. ;-).
Regards.
--
FFmpeg = Freak and Fantastic Mere Plastic Efficient Guru
More information about the ffmpeg-devel
mailing list