PR #23771 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23771
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23771.patch

Fixes: out of array access
Fixes: lut3d_poc/poc_3dlut2.dat
Fixes: 6p0ahHBxreqG
Found-by: SecBuddyF - Tencent KeenLab



>From 19de56247c2cb9577b2f1ae506c13019de1b618d Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Fri, 10 Jul 2026 04:07:17 +0200
Subject: [PATCH] avfilter/vf_lut3d: compute size2 after the 3DLUTSIZE
 directive

Fixes: out of array access
Fixes: lut3d_poc/poc_3dlut2.dat
Fixes: 6p0ahHBxreqG
Found-by: SecBuddyF - Tencent KeenLab
---
 libavfilter/vf_lut3d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 6ab33790c6..9071dabeb9 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -644,7 +644,6 @@ static int parse_dat(AVFilterContext *ctx, FILE *f)
     int ret, i, j, k, size, size2;
 
     lut3d->lutsize = size = 33;
-    size2 = size * size;
 
     NEXT_LINE(skip_line(line));
     if (!strncmp(line, "3DLUTSIZE ", 10)) {
@@ -652,6 +651,7 @@ static int parse_dat(AVFilterContext *ctx, FILE *f)
 
         NEXT_LINE(skip_line(line));
     }
+    size2 = size * size;
 
     ret = allocate_3dlut(ctx, size, 0);
     if (ret < 0)
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to