aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wmv2enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-07-24 04:24:33 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-07-27 14:44:07 +0100
commit03eb55741427c6608f63972c105e565ca0ba4f15 (patch)
treee4282fcadb90f773329459753495d89de1730bf6 /libavcodec/wmv2enc.c
parenta67b67944aa9e6e794934d15f9fd9a9cf7173e09 (diff)
downloadffmpeg-03eb55741427c6608f63972c105e565ca0ba4f15.tar.gz
wmv2enc: Check memory allocation
Diffstat (limited to 'libavcodec/wmv2enc.c')
-rw-r--r--libavcodec/wmv2enc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index e4e51d32f9..e4d4159e37 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -63,6 +63,9 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx)
avctx->extradata_size = 4;
avctx->extradata = av_mallocz(avctx->extradata_size + 10);
+ if (!avctx->extradata)
+ return AVERROR(ENOMEM);
+
encode_ext_header(w);
return 0;