aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2024-06-08 18:39:10 +1000
committerPeter Ross <pross@xvid.org>2024-11-21 19:41:12 +1100
commit63ea1660fa06d30c3bcbad68373a6caf88ac9c4c (patch)
tree2642dca38272e28f04069c53da90b0ea38526d5f
parentac2442f0a7a97d41089fffe51cc831913799c89b (diff)
downloadffmpeg-63ea1660fa06d30c3bcbad68373a6caf88ac9c4c.tar.gz
avcodec/mm: decode partial palette
-rw-r--r--libavcodec/mmvideo.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 3038d9ea92..933d895f96 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -78,13 +78,10 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
static void mm_decode_pal(MmContext *s)
{
- int i;
-
- bytestream2_skip(&s->gb, 4);
- for (i = 0; i < 128; i++) {
- s->palette[i] = 0xFFU << 24 | bytestream2_get_be24(&s->gb);
- s->palette[i+128] = s->palette[i]<<2;
- }
+ int start = bytestream2_get_le16(&s->gb);
+ int count = bytestream2_get_le16(&s->gb);
+ for (int i = 0; i < count; i++)
+ s->palette[start+i] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) << 2);
}
/**