diff mbox series

[FFmpeg-devel,1/2] swscale/slice: clear allocated memory in alloc_lines()

Message ID 20241019011722.840224-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/2] swscale/slice: clear allocated memory in alloc_lines() | expand

Commit Message

Michael Niedermayer Oct. 19, 2024, 1:17 a.m. UTC
Fixes: use of uninitialized memory in hScale16To15_c()
Fixes: 373924007/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5841199968092160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libswscale/slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/slice.c b/libswscale/slice.c
index 119bfbdb8d1..4f8e1cebe19 100644
--- a/libswscale/slice.c
+++ b/libswscale/slice.c
@@ -60,7 +60,7 @@  static int alloc_lines(SwsSlice *s, int size, int width)
         for (j = 0; j < n; ++j) {
             // chroma plane line U and V are expected to be contiguous in memory
             // by mmx vertical scaler code
-            s->plane[i].line[j] = av_malloc(size * 2 + 32);
+            s->plane[i].line[j] = av_mallocz(size * 2 + 32);
             if (!s->plane[i].line[j]) {
                 free_lines(s);
                 return AVERROR(ENOMEM);