mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-21 13:21:55 +08:00
avcodec/ffv1: Clear state on alloc
Fixes: use of uninitialized memory
Fixes: 428969823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-5909681623334912
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70fc46d185)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -69,7 +69,7 @@ av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs)
|
||||
|
||||
if (fs->ac != AC_GOLOMB_RICE) {
|
||||
if (!p->state)
|
||||
p->state = av_malloc_array(p->context_count, CONTEXT_SIZE *
|
||||
p->state = av_calloc(p->context_count, CONTEXT_SIZE *
|
||||
sizeof(uint8_t));
|
||||
if (!p->state)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user