summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-11 19:17:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-11 21:19:45 +0200
commit1632a576e68c27229b31f0d1203ff90220e0e024 (patch)
tree346831a3b4218c1c5349b13a941326b7e6efe171 /libavformat/ape.c
parentc8ce2b0a1dce4f07b74c4686682bf72dbd307290 (diff)
Fixed segfault on memory allocation failure in ape demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 61590bdd35..cfac93381c 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);
}