1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avcodec/dxv: Check that we initialize op_data

Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

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
2025-08-08 12:25:55 +02:00
committed by michaelni
parent 4a0b793737
commit 6a8c41dcac

View File

@@ -275,7 +275,9 @@ static int dxv_decompress_opcodes(GetByteContext *gb, void *dstp, size_t op_size
if ((flag & 3) == 0) { if ((flag & 3) == 0) {
bytestream2_skip(gb, 1); bytestream2_skip(gb, 1);
bytestream2_get_buffer(gb, dstp, op_size); int read_size = bytestream2_get_buffer(gb, dstp, op_size);
if (read_size != op_size)
return AVERROR_INVALIDDATA;
} else if ((flag & 3) == 1) { } else if ((flag & 3) == 1) {
bytestream2_skip(gb, 1); bytestream2_skip(gb, 1);
memset(dstp, bytestream2_get_byte(gb), op_size); memset(dstp, bytestream2_get_byte(gb), op_size);