From 1dcce49e10dcebde9d2cc52565fa299c5fdfd691 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 19 Dec 2011 19:11:49 +0100 Subject: soxdec: check av_malloc return. Bug found by: durandal_1707 Signed-off-by: Michael Niedermayer --- libavformat/soxdec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/soxdec.c') diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index ad8f488961..23fea38fd4 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -98,6 +98,8 @@ static int sox_read_header(AVFormatContext *s, if (comment_size && comment_size < UINT_MAX) { char *comment = av_malloc(comment_size+1); + if(!comment) + return AVERROR(ENOMEM); if (avio_read(pb, comment, comment_size) != comment_size) { av_freep(&comment); return AVERROR(EIO); -- cgit v1.2.3