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

Michael Niedermayer michaelni
Mon May 10 00:18:58 CEST 2010


On Mon, May 10, 2010 at 12:11:36AM +0200, Sebastian Vater wrote:
> M?ns Rullg?rd a ?crit :
> > Sebastian Vater <cdgs.basty at googlemail.com> writes:
> >
> >   
> >> +    if ((avctx->width <= 0) || (avctx->height <= 0)) {
> >>     
> >
> > Too much () IMO.
> >   
> 
> Fixed. Better this way? ;)
> 
> Although I personally prefer the method with the extra (), find it
> myself a bit more readable.
> So if you don't hesistate, please apply the other one.
> 
> -- 
> 
> Best regards,
>                    :-) Basty/CDGS (-:
> 

>  iff.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 08c5fcadfb4c543760e770f663d7252d50fac394  iff-decoder-width-height-check.patch
> 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 not supported\n");

i think "width or height" is clearer / less ambigous

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20100510/f4822b71/attachment.pgp>



More information about the ffmpeg-devel mailing list