summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/assdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c
index 3178f29..f0b1069 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;
OpenPOWER on IntegriCloud