summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-04-28 00:09:46 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-04-28 00:09:46 +0200
commit5a810f4e27ea770a0d3a079b5871b668d3a56902 (patch)
treedfb8f73f658774c1ea99a82bb233f4a929794d08
parent045cc36fe788752bca340efb736e7d76aa7f54e9 (diff)
Return if memory allocation fails.
-rw-r--r--libavcodec/tta.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index ece5c1c43b..96a2f51c78 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);