[FFmpeg-cvslog] ape demuxer: fix segfault on memory allocation failure.

Laurent Aimar git at videolan.org
Thu Nov 3 03:57:36 CET 2011


ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Sun Sep 11 19:17:40 2011 +0200| [19431d4d4ee2bb727d3810d40db846bb82dba658] | committer: Michael Niedermayer

ape demuxer: fix segfault on memory allocation failure.

Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19431d4d4ee2bb727d3810d40db846bb82dba658
---

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

diff --git a/libavformat/ape.c b/libavformat/ape.c
index 3031e47..7511d93 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -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);
     }



More information about the ffmpeg-cvslog mailing list