Fixed segfault on memory allocation failure in ape demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 11 Sep 2011 17:17:40 +0000 (19:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Sep 2011 16:02:25 +0000 (18:02 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1632a576e68c27229b31f0d1203ff90220e0e024)

libavformat/ape.c

index bda6b32..b0f2394 100644 (file)
@@ -270,6 +270,8 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
 
     if (ape->seektablelength > 0) {
         ape->seektable = av_malloc(ape->seektablelength);
+        if (!ape->seektable)
+            return AVERROR(ENOMEM);
         for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
             ape->seektable[i] = avio_rl32(pb);
     }