X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmsvideo1.c;h=99965b04a2cc02377ce97c566b334bdd20d801ae;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=de048d8b6fb9a33fcf6889855ac054d6272853c7;hpb=0084eed5bffebd7f3915bc0f9eba7350e8bc0ef7;p=ffmpeg diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index de048d8b6fb..99965b04a2c 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -33,6 +33,7 @@ #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "decode.h" #include "internal.h" #define PALETTE_COUNT 256 @@ -310,19 +311,11 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; if (s->mode_8bit) { - int size; - const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size); - - if (pal && size == AVPALETTE_SIZE) { - memcpy(s->pal, pal, AVPALETTE_SIZE); - s->frame->palette_has_changed = 1; - } else if (pal) { - av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size); - } + s->frame->palette_has_changed = ff_copy_palette(s->pal, avpkt, avctx); } if (s->mode_8bit) @@ -348,7 +341,7 @@ static av_cold int msvideo1_decode_end(AVCodecContext *avctx) return 0; } -AVCodec ff_msvideo1_decoder = { +const AVCodec ff_msvideo1_decoder = { .name = "msvideo1", .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video 1"), .type = AVMEDIA_TYPE_VIDEO,