[FFmpeg-devel] [PATCH 1/6] Fixed segfault on memory allocation failure in ape demuxer.

fenrir at elivagar.org fenrir at elivagar.org
Sun Sep 11 19:17:40 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

---
 libavformat/ape.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index 61590bd..cfac933 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -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);
     }
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list