History

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)

Michael Niedermayer committed 7 years ago

Commit 47b6ca01 parent 38b6c481 file · +2 −1Browse files

Unified · Split

libavcodec/assdec.c+2−1
@@ -31,7 +31,8 @@ static av_cold int ass_decode_init(AVCodecContext *avctx) · 30 unmodified lines
31 avctx->subtitle_header = av_malloc(avctx->extradata_size + 1);31 avctx->subtitle_header = av_malloc(avctx->extradata_size + 1);
32 if (!avctx->subtitle_header)32 if (!avctx->subtitle_header)
33 return AVERROR(ENOMEM);33 return AVERROR(ENOMEM);
34 memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size);34 if (avctx->extradata_size)
35 memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size);
35 avctx->subtitle_header[avctx->extradata_size] = 0;36 avctx->subtitle_header[avctx->extradata_size] = 0;
36 avctx->subtitle_header_size = avctx->extradata_size;37 avctx->subtitle_header_size = avctx->extradata_size;
37 return 0;38 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t