[FFmpeg-devel] [PATCH 7/8] avcodec/aic: Clear slice_data

Michael Niedermayer michael at niedermayer.cc
Sun Aug 4 23:53:08 EEST 2024


Fixes: use-of-uninitialized-value
Fixes: 70865/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-4874102695854080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/aic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index 3ff170b414f..e12d689c478 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -465,8 +465,7 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
         }
     }
 
-    ctx->slice_data = av_malloc_array(ctx->slice_width, AIC_BAND_COEFFS
-                                * sizeof(*ctx->slice_data));
+    ctx->slice_data = av_calloc(ctx->slice_width, AIC_BAND_COEFFS * sizeof(*ctx->slice_data));
     if (!ctx->slice_data) {
         av_log(avctx, AV_LOG_ERROR, "Error allocating slice buffer\n");
 
-- 
2.45.2



More information about the ffmpeg-devel mailing list