[FFmpeg-cvslog] avcodec/wmaenc: Check extradata allocations

Michael Niedermayer git at videolan.org
Sun Feb 22 22:13:32 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 22 21:23:39 2015 +0100| [8559a714155a7bc79d4802558f509e211379a8a0] | committer: Michael Niedermayer

avcodec/wmaenc: Check extradata allocations

Fixes CID1257842

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

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

 libavcodec/wmaenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 08d45e9..b922acd 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -60,11 +60,15 @@ static av_cold int encode_init(AVCodecContext *avctx)
     flags2 = 1;
     if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
         extradata             = av_malloc(4);
+        if (!extradata)
+            return AVERROR(ENOMEM);
         avctx->extradata_size = 4;
         AV_WL16(extradata, flags1);
         AV_WL16(extradata + 2, flags2);
     } else if (avctx->codec->id == AV_CODEC_ID_WMAV2) {
         extradata             = av_mallocz(10);
+        if (!extradata)
+            return AVERROR(ENOMEM);
         avctx->extradata_size = 10;
         AV_WL32(extradata, flags1);
         AV_WL16(extradata + 4, flags2);



More information about the ffmpeg-cvslog mailing list