summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <[email protected]>2011-09-11 19:17:40 +0200
committerReinhard Tartler <[email protected]>2011-12-24 12:20:33 +0100
commit44925239383d54af3d329fb5b12345f6209e8e62 (patch)
treec49c75b5c5aa46c57c105dcd3de15450350543ef
parenta97e82c48762cd0b1faa249cc0ec3469f149c5f0 (diff)
ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <[email protected]> (cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99) Signed-off-by: Anton Khirnov <[email protected]> (cherry picked from commit 4ee014309c377f7cfaa9578a393864ae500136f6) Signed-off-by: Reinhard Tartler <[email protected]>
-rw-r--r--libavformat/ape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 0ebc307668..56a9c78a39 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -263,6 +263,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);
}