aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-30 23:59:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-03 21:03:14 +0100
commite34369e8ece08b7bd820366dea5965f4c40c0080 (patch)
treea8020352386813d40dec3bf06cc3f89bdf6bc4d9
parent74241de7ed501a34e7dfe291eed3339ca7b50755 (diff)
downloadffmpeg-e34369e8ece08b7bd820366dea5965f4c40c0080.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> (cherry picked from commit a7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed)
-rw-r--r--libavcodec/qdm2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 3a77e7fe06..7f565dd3d7 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1259,6 +1259,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) {