avcodec/svq3: fix slice size check

Fixes out of array read
Fixes: 09f46aa2175cade93e3e3932646a56a9/asan_heap-oob_4a5385_2995_498f6abfdc0248288cefe5f4b7ad316c.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/230/head
Michael Niedermayer 8 years ago
parent 8b43ee4054
commit 2624695484
  1. 2
      libavcodec/svq3.c

@ -1040,7 +1040,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
slice_bits = slice_length * 8;
slice_bytes = slice_length + length - 1;
if (slice_bytes > get_bits_left(&s->gb)) {
if (8LL*slice_bytes > get_bits_left(&s->gb)) {
av_log(avctx, AV_LOG_ERROR, "slice after bitstream end\n");
return -1;
}

Loading…
Cancel
Save