avcodec/rawdec: Initialize default mono palette only for bits_per_coded_sample == 1
authorMats Peterson <matsp888@yahoo.com>
Fri, 12 Feb 2016 10:24:30 +0000 (11:24 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 Feb 2016 23:58:29 +0000 (00:58 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rawdec.c

index b7ce2b6..1b85b96 100644 (file)
@@ -100,7 +100,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
             avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
         else {
             memset(context->palette->data, 0, AVPALETTE_SIZE);
-            if (avctx->bits_per_coded_sample <= 1)
+            if (avctx->bits_per_coded_sample == 1)
                 memset(context->palette->data, 0xff, 4);
         }
     }