diff options
Diffstat (limited to 'libavcodec/8bps.c')
-rw-r--r-- | libavcodec/8bps.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 53e939d35d..dda8b8b1c9 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -37,6 +37,7 @@ #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "decode.h" #include "internal.h" @@ -122,16 +123,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } if (avctx->bits_per_coded_sample <= 8) { - buffer_size_t size; - const uint8_t *pal = av_packet_get_side_data(avpkt, - AV_PKT_DATA_PALETTE, - &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); - } + frame->palette_has_changed = ff_copy_palette(c->pal, avpkt, avctx); memcpy (frame->data[1], c->pal, AVPALETTE_SIZE); } |