Merge commit '532c96a2158c04f265d750d54f2f103b8d9fe0ef' into release/2.4
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Feb 2015 19:32:46 +0000 (20:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Feb 2015 19:32:53 +0000 (20:32 +0100)
* commit '532c96a2158c04f265d750d54f2f103b8d9fe0ef':
  matroskadec: Fix read-after-free in matroska_read_seek()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskadec.c

index beb1aef..2d5aa62 100644 (file)
@@ -2911,7 +2911,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
                               int64_t timestamp, int flags)
 {
     MatroskaDemuxContext *matroska = s->priv_data;
-    MatroskaTrack *tracks = matroska->tracks.elem;
+    MatroskaTrack *tracks = NULL;
     AVStream *st = s->streams[stream_index];
     int i, index, index_sub, index_min;
 
@@ -2941,6 +2941,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
         goto err;
 
     index_min = index;
+    tracks = matroska->tracks.elem;
     for (i = 0; i < matroska->tracks.nb_elem; i++) {
         tracks[i].audio.pkt_cnt        = 0;
         tracks[i].audio.sub_packet_cnt = 0;