aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-11 19:17:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-03 03:27:24 +0100
commit19431d4d4ee2bb727d3810d40db846bb82dba658 (patch)
treea3e9096e7b12ae36b26f991291b2177dec203bb3
parentecd6fa11c2cde5ca3fb787a2cfeb594d6205684b (diff)
downloadffmpeg-19431d4d4ee2bb727d3810d40db846bb82dba658.tar.gz
ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavformat/ape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 3031e4767b..7511d936da 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);
}