[FFmpeg-cvslog] asv: Check memory allocation

Vittorio Giovara git at videolan.org
Mon Jun 1 01:52:09 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun May 31 14:50:21 2015 +0200| [e524f37356156893cae50fc46451bd4a6198703d] | committer: Luca Barbato

asv: Check memory allocation

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

 libavcodec/asvenc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index f8c52af..0879615 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -299,6 +299,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
                      avctx->global_quality / 2) / avctx->global_quality;
 
     avctx->extradata                   = av_mallocz(8);
+    if (!avctx->extradata)
+        return AVERROR(ENOMEM);
     avctx->extradata_size              = 8;
     ((uint32_t *) avctx->extradata)[0] = av_le2ne32(a->inv_qscale);
     ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS"));



More information about the ffmpeg-cvslog mailing list