[FFmpeg-cvslog] ffv1enc: check for malloc failure
Michael Niedermayer
git at videolan.org
Sat Aug 17 01:49:32 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Aug 17 01:38:32 2013 +0200| [eeb3fb9e62d4647e1fee5d262be63e793117430d] | committer: Michael Niedermayer
ffv1enc: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eeb3fb9e62d4647e1fee5d262be63e793117430d
---
libavcodec/ffv1enc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 23fb23b..bb7e087 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -529,6 +529,8 @@ static int write_extradata(FFV1Context *f)
f->avctx->extradata_size = 10000 + 4 +
(11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32;
f->avctx->extradata = av_malloc(f->avctx->extradata_size);
+ if (!f->avctx->extradata)
+ return AVERROR(ENOMEM);
ff_init_range_encoder(c, f->avctx->extradata, f->avctx->extradata_size);
ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
More information about the ffmpeg-cvslog
mailing list