X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fassdec.c;h=f0b1069cd255407cf697851e312697cc6d066558;hb=e5bcda6473a2d6984216004506374669501fcf3b;hp=3178f2953ca6a73a8a641aca7995ab400af40b53;hpb=26148e923613e718787c6fc4bf3f64e8909f597c;p=ffmpeg diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index 3178f2953ca..f0b1069cd25 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -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;