OSDN Git Service

iff: fix null ptr dereference
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2012 14:41:21 +0000 (16:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2012 15:27:54 +0000 (17:27 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/iff.c

index 841dff6..0a4a983 100644 (file)
@@ -474,7 +474,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
     } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return res;
-    } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {
+    } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt == PIX_FMT_PAL8) {
         if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
             return res;
     }