Avoid spurious dimension check messages that the parser might trigger.
---
libavcodec/pnm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 1c380b0..a7f4ae6 100644
--- 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;
if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
--
2.3.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel