diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-30 23:59:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-01 00:00:08 +0100 |
commit | a7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed (patch) | |
tree | 3e557690a64cb5bba76d20a40a090da33ae1f203 /libavcodec/qdm2.c | |
parent | 991e23519ac53adc624338b3a7628c9c289268cb (diff) | |
download | ffmpeg-a7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed.tar.gz |
qdm2: check array index before use, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r-- | libavcodec/qdm2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 4cf4b2f932..1dfb8d5715 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1257,6 +1257,11 @@ static void qdm2_decode_super_block (QDM2Context *q) for (i = 0; packet_bytes > 0; i++) { int j; + if (i>=FF_ARRAY_ELEMS(q->sub_packet_list_A)) { + SAMPLES_NEEDED_2("too many packet bytes"); + return; + } + q->sub_packet_list_A[i].next = NULL; if (i > 0) { |