1
From 4ee014309c377f7cfaa9578a393864ae500136f6 Mon Sep 17 00:00:00 2001
2
From: Laurent Aimar <fenrir@videolan.org>
3
Date: Sun, 11 Sep 2011 19:17:40 +0200
4
Subject: [PATCH 55/70] ape demuxer: fix segfault on memory allocation failure.
6
Signed-off-by: Anton Khirnov <anton@khirnov.net>
7
(cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99)
9
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11
libavformat/ape.c | 2 ++
12
1 files changed, 2 insertions(+), 0 deletions(-)
14
diff --git a/libavformat/ape.c b/libavformat/ape.c
15
index 90b0261..b084100 100644
16
--- a/libavformat/ape.c
17
+++ b/libavformat/ape.c
18
@@ -270,6 +270,8 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
20
if (ape->seektablelength > 0) {
21
ape->seektable = av_malloc(ape->seektablelength);
22
+ if (!ape->seektable)
23
+ return AVERROR(ENOMEM);
24
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
25
ape->seektable[i] = avio_rl32(pb);