summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/pnm_parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c
index a7d70b9931..43dbfc7f27 100644
--- a/libavcodec/pnm_parser.c
+++ b/libavcodec/pnm_parser.c
@@ -66,6 +66,8 @@ retry:
}
#endif
next = END_NOT_FOUND;
+ } else if (pnmctx.type < 4) {
+ next = END_NOT_FOUND;
} else {
next = pnmctx.bytestream - pnmctx.bytestream_start
+ av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);