ape demuxer: fix segfault on memory allocation failure.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 11 Sep 2011 17:17:40 +0000 (19:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Nov 2011 02:27:24 +0000 (03:27 +0100)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/ape.c

index 3031e47..7511d93 100644 (file)
@@ -356,6 +356,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] = get_le32(pb);
     }