]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/assdec.c
Merge commit '8136f234445862c94d1c081606b2d1e3d44fccf3'
[ffmpeg] / libavcodec / assdec.c
index 5a51703e86336f97a185f7d975babefa6e651623..d79065663b0cc9e97f3d0b6599216c0c939e1623 100644 (file)
 
 static av_cold int ass_decode_init(AVCodecContext *avctx)
 {
-    avctx->subtitle_header = av_malloc(avctx->extradata_size);
+    avctx->subtitle_header = av_malloc(avctx->extradata_size + 1);
     if (!avctx->subtitle_header)
         return AVERROR(ENOMEM);
     memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size);
+    avctx->subtitle_header[avctx->extradata_size] = 0;
     avctx->subtitle_header_size = avctx->extradata_size;
     avctx->priv_data = ff_ass_split(avctx->extradata);
     if(!avctx->priv_data)