From: Laurent Aimar Date: Sun, 11 Sep 2011 17:17:40 +0000 (+0200) Subject: ape demuxer: fix segfault on memory allocation failure. X-Git-Tag: android-x86-4.4-r1~8529^2~5517 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=273aab99bf7be2bcda95dd64101c2317ee0fcb99;p=android-x86%2Fexternal-ffmpeg.git ape demuxer: fix segfault on memory allocation failure. Signed-off-by: Anton Khirnov --- 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); }