diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-17 22:43:32 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-22 02:43:04 +0100 |
commit | 7b100839330ace3b4846ee4a1fc5caf4b8f8a34e (patch) | |
tree | 5743c922bd05a372bfbe733cf7ee482153d8e55d /libavcodec/interplayvideo.c | |
parent | ab5803553b3932da3227647ae27f2e2795cc5752 (diff) | |
download | ffmpeg-7b100839330ace3b4846ee4a1fc5caf4b8f8a34e.tar.gz |
avcodec: Factor updating palette out
Because the properties of frames returned from ff_get/reget_buffer
are not reset at all, lots of returned frames had palette_has_changed
wrongly set to 1. This has been changed, too.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/interplayvideo.c')
-rw-r--r-- | libavcodec/interplayvideo.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 4d16fdf619..388fe2665e 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -43,6 +43,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "bytestream.h" +#include "decode.h" #include "get_bits.h" #include "hpeldsp.h" #include "internal.h" @@ -1317,14 +1318,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, return ret; if (!s->is_16bpp) { - 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(s->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(s->pal, avpkt, avctx); } switch (frame_format) { |