X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2F8bps.c;h=aa2318fa2d817288ba6bc604076e04b0fa9c19c1;hb=54d839e80a06ed7c195ed0b60af3cd7a744e7085;hp=49fd44549486b0a7081ee86787f162065fcadbe9;hpb=62c58c59d54fda034ed7f7c16e3faa1bdaa1e16d;p=ffmpeg diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 49fd4454948..aa2318fa2d8 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -122,12 +122,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, } if (avctx->bits_per_coded_sample <= 8) { + int size; const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, - NULL); - if (pal) { + &size); + if (pal && size == AVPALETTE_SIZE) { frame->palette_has_changed = 1; memcpy(c->pal, pal, AVPALETTE_SIZE); + } else if (pal) { + av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size); } memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);