aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/ape.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-11 19:17:40 +0200
committerAnton Khirnov <anton@khirnov.net>2011-09-12 21:12:31 +0200
commit273aab99bf7be2bcda95dd64101c2317ee0fcb99 (patch)
tree0bf95271d5dac6bec0d3ce806b50a4e8e3380148 /libavformat/ape.c
parent0872bb23b4bd2d94a8ba91070f706d1bc1c3ced8 (diff)
downloadffmpeg-273aab99bf7be2bcda95dd64101c2317ee0fcb99.tar.gz
ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index a49da5c73a..088515c58a 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);
}