ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Fri 
Jul 19 17:08:22 2024 +0200| [6194cb87cb81ef97adfa2690e489f473182eaffe] | 
committer: Michael Niedermayer

avcodec/alsdec: Clear shift_value

(the exact issue is unreproducable but the use of uninitialized data is 
reproducable)

Should fix: signed integer overflow: -2147483648 - 127 cannot be represented in 
type 'int'
Should fix: 
69881/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4751301204836352

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6194cb87cb81ef97adfa2690e489f473182eaffe
---

 libavcodec/alsdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index be72994432..f4f67917d7 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -2110,8 +2110,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     if (sconf->floating) {
         ctx->acf               = av_malloc_array(channels, sizeof(*ctx->acf));
-        ctx->shift_value       = av_malloc_array(channels, 
sizeof(*ctx->shift_value));
-        ctx->last_shift_value  = av_malloc_array(channels, 
sizeof(*ctx->last_shift_value));
+        ctx->shift_value       = av_calloc(channels, 
sizeof(*ctx->shift_value));
+        ctx->last_shift_value  = av_calloc(channels, 
sizeof(*ctx->last_shift_value));
         ctx->last_acf_mantissa = av_malloc_array(channels, 
sizeof(*ctx->last_acf_mantissa));
         ctx->raw_mantissa      = av_calloc(channels, 
sizeof(*ctx->raw_mantissa));
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to