X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fassdec.c;h=3b1a119496942ffcdaa1c05116cc9d09a2203371;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=3178f2953ca6a73a8a641aca7995ab400af40b53;hpb=409e684e79b6ee0c511292326f09b13fe230e58e;p=ffmpeg diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index 3178f2953ca..3b1a1194969 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; @@ -61,7 +62,7 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, } #if CONFIG_SSA_DECODER -AVCodec ff_ssa_decoder = { +const AVCodec ff_ssa_decoder = { .name = "ssa", .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), .type = AVMEDIA_TYPE_SUBTITLE, @@ -72,7 +73,7 @@ AVCodec ff_ssa_decoder = { #endif #if CONFIG_ASS_DECODER -AVCodec ff_ass_decoder = { +const AVCodec ff_ass_decoder = { .name = "ass", .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), .type = AVMEDIA_TYPE_SUBTITLE,