[FFmpeg-cvslog] Return if memory allocation fails.

Carl Eugen Hoyos git at videolan.org
Thu Apr 28 00:11:58 CEST 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Apr 28 00:09:46 2011 +0200| [5a810f4e27ea770a0d3a079b5871b668d3a56902] | committer: Carl Eugen Hoyos

Return if memory allocation fails.

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

 libavcodec/tta.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index ece5c1c..96a2f51 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -286,6 +286,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
         }
 
         s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
+        if (!s->decode_buffer)
+            return AVERROR(ENOMEM);
         s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
         if (!s->ch_ctx)
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list