1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-04 17:44:49 +02:00

avcodec/rawdec: Initialize default mono palette only for bits_per_coded_sample == 1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Mats Peterson 2016-02-12 11:24:30 +01:00 committed by Michael Niedermayer
parent f80b4750b9
commit bbb45773b0

View 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); avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
else { else {
memset(context->palette->data, 0, AVPALETTE_SIZE); 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); memset(context->palette->data, 0xff, 4);
} }
} }