Commit 1c638cfc authored by Paul B Mahol's avatar Paul B Mahol

jvdec: stop reading partial palette

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent c673a90b
...@@ -174,8 +174,8 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -174,8 +174,8 @@ static int decode_frame(AVCodecContext *avctx,
} }
} }
if (buf < buf_end) { if (buf_end - buf >= AVPALETTE_COUNT * 3) {
for (i = 0; i < AVPALETTE_COUNT && buf + 3 <= buf_end; i++) { for (i = 0; i < AVPALETTE_COUNT; i++) {
uint32_t pal = AV_RB24(buf); uint32_t pal = AV_RB24(buf);
s->palette[i] = 0xFF << 24 | pal << 2 | ((pal >> 4) & 0x30303); s->palette[i] = 0xFF << 24 | pal << 2 | ((pal >> 4) & 0x30303);
buf += 3; buf += 3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment