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>
Sun, 11 Sep 2011 19:19:45 +0000 (21:19 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/ape.c

index 61590bd..cfac933 100644 (file)
@@ -273,6 +273,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);
     }