]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/kmvc: Prefer in-band palette
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 22 Mar 2021 01:14:35 +0000 (02:14 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Mar 2021 23:32:47 +0000 (00:32 +0100)
Fixes decoding of https://samples.ffmpeg.org/V-codecs/KMVC/LOGO2.AVI

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/kmvc.c

index cd9e32f443064798a60b5f8757d27feb85dc96b1..8d9f0a96937a3d2e8ece287a866d572a3b652bda 100644 (file)
@@ -275,6 +275,8 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 
+    frame->palette_has_changed = ff_copy_palette(ctx->pal, avpkt, avctx);
+
     header = bytestream2_get_byte(&ctx->g);
 
     /* blocksize 127 is really palette change event */
@@ -303,9 +305,6 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
         }
     }
 
-    if (ff_copy_palette(ctx->pal, avpkt, avctx))
-        frame->palette_has_changed = 1;
-
     if (ctx->setpal) {
         ctx->setpal = 0;
         frame->palette_has_changed = 1;