]> git.sesse.net Git - ffmpeg/commitdiff
mkv: Fix a bug where a pointer was cached to an array that might later move due to
authorChris Evans <cevans@chromium.org>
Wed, 4 Jan 2012 15:33:34 +0000 (16:33 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 4 Jan 2012 20:58:08 +0000 (21:58 +0100)
a realloc()

BUG=100492
Review URL: http://codereview.chromium.org/8366004
Fixes: 1 of 2 for CVE-2011-3893
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskadec.c

index fd1001ef8e0326dfb4867898c0d9101c8fd014b5..600b1f4c60dd6c75a00917b5e7aac9c42305bf7e 100644 (file)
@@ -1223,7 +1223,6 @@ static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, int idx
 static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
 {
     EbmlList *seekhead_list = &matroska->seekhead;
-    MatroskaSeekhead *seekhead = seekhead_list->elem;
     int64_t before_pos = avio_tell(matroska->ctx->pb);
     int i;
 
@@ -1233,6 +1232,7 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
         return;
 
     for (i = 0; i < seekhead_list->nb_elem; i++) {
+        MatroskaSeekhead *seekhead = seekhead_list->elem;
         if (seekhead[i].pos <= before_pos)
             continue;