On 13/03/15 10:42, Diego Biurrun wrote: > On Fri, Mar 13, 2015 at 02:21:23AM +0100, Luca Barbato wrote: >> Avoid spurious dimension check messages that the parser might trigger. >> --- a/libavcodec/pnm.c >> +++ b/libavcodec/pnm.c >> @@ -140,6 +140,8 @@ int ff_pnm_decode_header(AVCodecContext *avctx, >> PNMContext * const s) >> return AVERROR_INVALIDDATA; >> pnm_get(s, buf1, sizeof(buf1)); >> avctx->height = atoi(buf1); >> + if (avctx->height <= 0) >> + return AVERROR_INVALIDDATA; >> if(av_image_check_size(avctx->width, avctx->height, 0, avctx)) >> return AVERROR_INVALIDDATA; > > WTH? Why are the checks duplicated? av_image_check_size validates width > and height?!? >
Because otherwise the false positives when used from the parser would trigger reports from concerned users. lu _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
