Browse Source

avcodec/mpeg12dec: check block index in mpeg2_fast_decode_block_non_intra()

Prevents some overreads at the cost of 1 cpu cycle

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
d82eccea2b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/mpeg12dec.c

+ 2
- 1
libavcodec/mpeg12dec.c View File

@@ -489,8 +489,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
}

block[j] = level;
if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF || i >= 64)
break;

UPDATE_CACHE(re, &s->gb);
}
end:


Loading…
Cancel
Save