[FFmpeg-cvslog] avformat/oggparseflac: check ff_alloc_extradata() return code

Michael Niedermayer git at videolan.org
Sun Oct 20 17:03:17 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 20 16:55:43 2013 +0200| [2c1e075308e14810149f53be87959a62cb83a730] | committer: Michael Niedermayer

avformat/oggparseflac: check ff_alloc_extradata() return code

Fixes CID1108573
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c1e075308e14810149f53be87959a62cb83a730
---

 libavformat/oggparseflac.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c
index 894b438..f69533f 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);



More information about the ffmpeg-cvslog mailing list