Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-18 17:58:03 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-05-18 17:59:45 +0400
commit6e8fe448154e1aa0928cb0d2e1aecb7255c751cc (patch)
treefae5081b13e1ea7153ffe030c7f787d39d21c362 /libavcodec/wmv2enc.c
parent5441eb460cb4b52eaf4bc440146c5e458edbea05 (diff)
avcodec/wmv2enc: allocate padding for extradata and check malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmv2enc.c')
-rw-r--r--libavcodec/wmv2enc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index 6aeee59ab2..869b3c7fe4 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -60,7 +60,9 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx){
ff_wmv2_common_init(w);
avctx->extradata_size= 4;
- avctx->extradata= av_mallocz(avctx->extradata_size + 10);
+ avctx->extradata= av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!avctx->extradata)
+ return AVERROR(ENOMEM);
encode_ext_header(w);
return 0;