Browse Source

jvdec: stop reading partial palette

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n1.0
Paul B Mahol 13 years ago
parent
commit
1c638cfc25
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/jvdec.c

+ 2
- 2
libavcodec/jvdec.c View File

@@ -174,8 +174,8 @@ static int decode_frame(AVCodecContext *avctx,
}
}

if (buf < buf_end) {
for (i = 0; i < AVPALETTE_COUNT && buf + 3 <= buf_end; i++) {
if (buf_end - buf >= AVPALETTE_COUNT * 3) {
for (i = 0; i < AVPALETTE_COUNT; i++) {
uint32_t pal = AV_RB24(buf);
s->palette[i] = 0xFF << 24 | pal << 2 | ((pal >> 4) & 0x30303);
buf += 3;


Loading…
Cancel
Save