From 2c1e075308e14810149f53be87959a62cb83a730 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 20 Oct 2013 16:55:43 +0200 Subject: [PATCH] avformat/oggparseflac: check ff_alloc_extradata() return code Fixes CID1108573 Signed-off-by: Michael Niedermayer --- libavformat/oggparseflac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c index 894b43850c..f69533f6c1 100644 --- a/libavformat/oggparseflac.c +++ b/libavformat/oggparseflac.c @@ -62,7 +62,8 @@ flac_header (AVFormatContext * s, int idx) st->codec->codec_id = AV_CODEC_ID_FLAC; st->need_parsing = AVSTREAM_PARSE_HEADERS; - ff_alloc_extradata(st->codec, FLAC_STREAMINFO_SIZE); + if (ff_alloc_extradata(st->codec, FLAC_STREAMINFO_SIZE) < 0) + return AVERROR(ENOMEM); memcpy(st->codec->extradata, streaminfo_start, st->codec->extradata_size); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);