mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/assdec: undefined use of memcpy()
Fixes: null pointer passed as argument 2, which is declared to never be null
Fixes: 16008/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SSA_fuzzer-5650582821404672 (this is a separate issue found in this testcase)
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 47b6ca0b02
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e46c1c68c6
commit
8c66aed22b
@ -32,7 +32,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;
|
||||
avctx->priv_data = ff_ass_split(avctx->extradata);
|
||||
|
Loading…
Reference in New Issue
Block a user