summaryrefslogtreecommitdiff
path: root/libavcodec/assenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/assenc.c')
-rw-r--r--libavcodec/assenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c
index 7ed21eedbc..50b89c00d6 100644
--- a/libavcodec/assenc.c
+++ b/libavcodec/assenc.c
@@ -28,11 +28,12 @@
static av_cold int ass_encode_init(AVCodecContext *avctx)
{
- avctx->extradata = av_malloc(avctx->subtitle_header_size);
+ avctx->extradata = av_malloc(avctx->subtitle_header_size + 1);
if (!avctx->extradata)
return AVERROR(ENOMEM);
memcpy(avctx->extradata, avctx->subtitle_header, avctx->subtitle_header_size);
avctx->extradata_size = avctx->subtitle_header_size;
+ avctx->extradata[avctx->extradata_size] = 0;
return 0;
}