]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/assdec.c
avformat/dashenc: Remove deprecated min_seg_duration option
[ffmpeg] / libavcodec / assdec.c
index 3178f2953ca6a73a8a641aca7995ab400af40b53..f0b1069cd255407cf697851e312697cc6d066558 100644 (file)
@@ -31,7 +31,8 @@ static av_cold int ass_decode_init(AVCodecContext *avctx)
     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);
+    if (avctx->extradata_size)
+        memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size);
     avctx->subtitle_header[avctx->extradata_size] = 0;
     avctx->subtitle_header_size = avctx->extradata_size;
     return 0;