mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
pictordec: fix cga palette index limit
Fixes out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ea1d8465e6
commit
478fc7f57b
@ -174,7 +174,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
npal = FFMIN(esize, 16);
|
||||
for (i = 0; i < npal; i++) {
|
||||
int pal_idx = bytestream2_get_byte(&s->g);
|
||||
palette[i] = ff_cga_palette[FFMIN(pal_idx, 16)];
|
||||
palette[i] = ff_cga_palette[FFMIN(pal_idx, 15)];
|
||||
}
|
||||
} else if (etype == 3) {
|
||||
npal = FFMIN(esize, 16);
|
||||
|
Loading…
Reference in New Issue
Block a user