diracdec: Correct the bytestream end pointer.

This fixes some arith decoder overreads and a potential infinite loop.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/3/merge
Michael Niedermayer 13 years ago
parent f095391a14
commit 0f13cc732b
  1. 2
      libavcodec/diracdec.c

@ -625,7 +625,7 @@ static void decode_component(DiracContext *s, int comp)
b->quant = svq3_get_ue_golomb(&s->gb);
align_get_bits(&s->gb);
b->coeff_data = s->gb.buffer + get_bits_count(&s->gb)/8;
b->length = FFMIN(b->length, get_bits_left(&s->gb)/8);
b->length = FFMIN(b->length, FFMAX(get_bits_left(&s->gb)/8, 0));
skip_bits_long(&s->gb, b->length*8);
}
}

Loading…
Cancel
Save