[FFmpeg-cvslog] qdm2: check array index before use, fix out of array accesses

Michael Niedermayer git at videolan.org
Sun Feb 17 04:30:35 CET 2013


ffmpeg | branch: release/0.5 | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 30 23:59:40 2012 +0100| [a23a3dba25448939e6be43c9196f1e6917258e2e] | committer: Michael Niedermayer

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 at gmx.at>
(cherry picked from commit a7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a23a3dba25448939e6be43c9196f1e6917258e2e
---

 libavcodec/qdm2.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index e2f1a87..ba68d02 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1262,6 +1262,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) {



More information about the ffmpeg-cvslog mailing list