tools/target_dec_fuzzer: Fix extradata duplication

Fixes: out of array access
Fixes: 36340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5872546875572224.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-07-24 18:18:23 +02:00
parent fc300613be
commit 54b798638e
1 changed files with 1 additions and 1 deletions

View File

@ -317,7 +317,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
parser_avctx->codec_id = ctx->codec_id;
parser_avctx->extradata_size = ctx->extradata_size;
parser_avctx->extradata = av_memdup(ctx->extradata, ctx->extradata_size);
parser_avctx->extradata = ctx->extradata ? av_memdup(ctx->extradata, ctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE) : NULL;
int got_frame;