[FFmpeg-cvslog] swscale/slice: clear allocated memory in alloc_lines()

Michael Niedermayer git at videolan.org
Thu Feb 27 19:08:11 EET 2025


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sat Oct 19 00:08:03 2024 +0200| [9fbcecf43544a90b71719b9360065e9d66f99334] | committer: Michael Niedermayer

swscale/slice: clear allocated memory in alloc_lines()

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 at niedermayer.cc>
(cherry picked from commit aeec39f3c1be82863efe64ce95242de58e075e8f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libswscale/slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/slice.c b/libswscale/slice.c
index f9c413cebd..925ce55f30 100644
--- a/libswscale/slice.c
+++ b/libswscale/slice.c
@@ -59,7 +59,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);



More information about the ffmpeg-cvslog mailing list