[FFmpeg-cvslog] diracdec: Correct the bytestream end pointer.
Michael Niedermayer
git at videolan.org
Fri Mar 16 16:31:00 CET 2012
ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 6 19:13:55 2012 +0100| [7f5bd6c72be0e75f4c2c0b4a7878e32ba29dca93] | committer: 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: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 0f13cc732b3752828890b8dff507615cfd454336)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f5bd6c72be0e75f4c2c0b4a7878e32ba29dca93
---
libavcodec/diracdec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 049f759..7fa7137 100644
--- a/libavcodec/diracdec.c
+++ b/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);
}
}
More information about the ffmpeg-cvslog
mailing list