iff: decode HAM8 images with masking correctly.
authorPiotr Bandurski <ami_stuff@o2.pl>
Sun, 18 Nov 2012 14:48:22 +0000 (15:48 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 18 Nov 2012 14:48:22 +0000 (15:48 +0100)
Fixes ticket #967.

Reviewed-by: Peter Ross
libavcodec/iff.c

index 9184015..9582f9d 100644 (file)
@@ -231,7 +231,7 @@ static int extract_header(AVCodecContext *const avctx,
         s->transparency = bytestream_get_be16(&buf);
         s->masking      = bytestream_get_byte(&buf);
         if (s->masking == MASK_HAS_MASK) {
-            if (s->bpp >= 8) {
+            if (s->bpp >= 8 && !s->ham) {
                 avctx->pix_fmt = AV_PIX_FMT_RGB32;
                 av_freep(&s->mask_buf);
                 av_freep(&s->mask_palbuf);