aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLidong Yan <yldhome2d2@gmail.com>2025-06-27 22:09:17 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2025-06-28 23:54:40 +0200
commita17596f55bcaac57c7670c053b28599bc6d1c347 (patch)
treed6d61615a3e6d2701243f393b804f77fa8fbf1f3
parent40a3d35da6ba51e0a4e59e754d033feefafc036d (diff)
downloadffmpeg-a17596f55bcaac57c7670c053b28599bc6d1c347.tar.gz
avfilter/vf_lut3d: fix leak if allocate_3dlut failed
In parse_cinespace(), memory allocated in in_prelut[] and out_prelut[] would leak if allocate_3dlut() failed. Replace return ret with goto end to free memory before return error code. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_lut3d.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 5f6bfc65b3..46afe36f6c 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -1006,7 +1006,7 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f)
ret = allocate_3dlut(ctx, size, prelut);
if (ret < 0)
- return ret;
+ goto end;
for (int k = 0; k < size; k++) {
for (int j = 0; j < size; j++) {