aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-30 23:59:40 +0100
committerReinhard Tartler <siretart@tauware.de>2013-12-14 14:31:03 -0500
commitb5736759eefab9d546668731bb6d06273edce012 (patch)
tree24daabf8d5cb9d01d1d53e4eee8addd168af728f
parentd4a24e43edd0c1a06d5dbf454448fde5b3d1d281 (diff)
downloadffmpeg-b5736759eefab9d546668731bb6d06273edce012.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) CC: libav-stable@libav.org Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit 39bec05ed42e505d17877b0c23f16322f9b5883b) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit 0b2b8ab979624b0cce673d5e99255482d7c553ad) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/qdm2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 1a076236cf..6b11b46d98 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1250,6 +1250,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) {