History

avcodec/mm: decode partial palette

Peter Ross committed 2 years ago

Commit 63ea1661 parent ac2442f1 file · +4 −7Browse files

Unified · Split

libavcodec/mmvideo.c+4−7
@@ -78,13 +78,10 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) · 77 unmodified lines
7878
7979 static void mm_decode_pal(MmContext *s)
8080 {
81− int i;
82−
83− bytestream2_skip(&s->gb, 4);
84− for (i = 0; i < 128; i++) {
85− s->palette[i] = 0xFFU << 24 | bytestream2_get_be24(&s->gb);
86− s->palette[i+128] = s->palette[i]<<2;
87− }
81+ int start = bytestream2_get_le16(&s->gb);
82+ int count = bytestream2_get_le16(&s->gb);
83+ for (int i = 0; i < count; i++)
84+ s->palette[start+i] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) << 2);
8885 }
8986
9087 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t