avcodec/mmvideo: fix palette index

Fixes: 391935573/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MMVIDEO_fuzzer-4655048979709952
Fixes: out of array access

Reviewed-by: Peter Ross <pross@xvid.org>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2025-05-08 15:30:57 +02:00
parent aeea2defe4
commit 43926e026d
No known key found for this signature in database
GPG key ID: B18E8928B3948D64

View file

@ -91,7 +91,7 @@ static void mm_decode_pal(MmContext *s)
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);
s->palette[(start+i)&0xFF] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) << 2);
}
/**