Commit 0f13cc73 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f095391a
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment