avcodec/rawdec: initialize palette for mono
authorMats Peterson <matsp888@yahoo.com>
Tue, 19 Jan 2016 17:48:06 +0000 (18:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 25 Jan 2016 10:07:42 +0000 (11:07 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rawdec.c

index cb0364c..1ab7112 100644 (file)
@@ -94,8 +94,11 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
             return AVERROR(ENOMEM);
         if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
             avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
-        else
+        else {
             memset(context->palette->data, 0, AVPALETTE_SIZE);
+            if (avctx->bits_per_coded_sample == 1)
+                memset(context->palette->data, 0xff, 4);
+        }
     }
 
     if ((avctx->extradata_size >= 9 &&