mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
jvdec: stop reading partial palette
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
c673a90b0d
commit
1c638cfc25
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user