avcodec/rawdec: initialize palette for mono

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Mats Peterson 2016-01-19 18:48:06 +01:00 committed by Michael Niedermayer
parent 1d8f9b7d1a
commit fe7639b1c8
1 changed files with 4 additions and 1 deletions

View 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 &&