summaryrefslogtreecommitdiff
path: root/libavcodec/rawdec.c
diff options
context:
space:
mode:
authorMats Peterson <matsp888@yahoo.com>2016-01-19 18:48:06 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-25 11:07:42 +0100
commitfe7639b1c8be49ced7465c6a91a9008f406cc5ba (patch)
tree5d10ae09e3cb279436beb3ac67f433e297b17672 /libavcodec/rawdec.c
parent1d8f9b7d1ad2a58f612b47e769d00e6f8891d881 (diff)
avcodec/rawdec: initialize palette for mono
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index cb0364c56e..1ab7112627 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -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 &&