1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-23 04:24:35 +02:00

avcodec/mm: decode partial palette

This commit is contained in:
Peter Ross 2024-06-08 18:39:10 +10:00
parent ac2442f0a7
commit 63ea1660fa

View File

@ -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);
}
/**