]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pnm.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / pnm.c
index 2cbbdf60ea96ad83a7c5562152db85e96fd8ff01..dfc18d6013858771b674f809211f9e4497fbd0c9 100644 (file)
@@ -135,7 +135,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
         return -1;
     pnm_get(s, buf1, sizeof(buf1));
     avctx->height = atoi(buf1);
-    if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
+    if(avctx->height <= 0 || av_image_check_size(avctx->width, avctx->height, 0, avctx))
         return -1;
     if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
         pnm_get(s, buf1, sizeof(buf1));