[FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: clear window

Michael Niedermayer michael at niedermayer.cc
Tue Nov 5 04:23:25 EET 2024


Fixes: Use of uninitialised value of size 8
Fixes: 368725676/clusterfuzz-testcase-minimized-fuzzer_protocol_file-6022251122589696-cut
Fixes: 42537758/clusterfuzz-testcase-minimized-fuzzer_protocol_file-5818969469026304-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/jpegxl_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c
index 8c45e1a1b73..179ca1170bd 100644
--- a/libavcodec/jpegxl_parser.c
+++ b/libavcodec/jpegxl_parser.c
@@ -847,7 +847,7 @@ static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec,
     }
 
     if (bundle->lz77_enabled && !dec->window) {
-        dec->window = av_malloc_array(1 << 20, sizeof(uint32_t));
+        dec->window = calloc(1 << 20, sizeof(uint32_t));
         if (!dec->window)
             return AVERROR(ENOMEM);
     }
-- 
2.47.0



More information about the ffmpeg-devel mailing list