[Bf-blender-cvs] [269f4a3024f] master: Fix VSE left crop not working

Richard Antalik noreply at git.blender.org
Fri Oct 22 14:32:22 CEST 2021


Commit: 269f4a3024f05378a2305b15be41d35e867dae51
Author: Richard Antalik
Date:   Fri Oct 22 14:20:26 2021 +0200
Branches: master
https://developer.blender.org/rB269f4a3024f05378a2305b15be41d35e867dae51

Fix VSE left crop not working

Caused by using 3D math on 2D vectors, violating memory boundaries.

Use temporary float[3] variable.

===================================================================

M	source/blender/imbuf/intern/imageprocess.c

===================================================================

diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index f01d2efa3ed..0ec1e4c19d8 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -388,13 +388,15 @@ static void imb_transform_calc_add_x(const float transform_matrix[4][4],
                                      const int width,
                                      float r_add_x[2])
 {
+  float r_add_x_temp[3];
   float uv_max_x[3];
   zero_v3(uv_max_x);
   uv_max_x[0] = width;
   uv_max_x[1] = 0.0f;
-  mul_v3_m4v3(r_add_x, transform_matrix, uv_max_x);
-  sub_v2_v2(r_add_x, start_uv);
-  mul_v2_fl(r_add_x, 1.0f / width);
+  mul_v3_m4v3(r_add_x_temp, transform_matrix, uv_max_x);
+  sub_v2_v2(r_add_x_temp, start_uv);
+  mul_v2_fl(r_add_x_temp, 1.0f / width);
+  copy_v2_v2(r_add_x, r_add_x_temp);
 }
 
 static void imb_transform_calc_add_y(const float transform_matrix[4][4],
@@ -402,13 +404,15 @@ static void imb_transform_calc_add_y(const float transform_matrix[4][4],
                                      const int height,
                                      float r_add_y[2])
 {
+  float r_add_y_temp[3];
   float uv_max_y[3];
   zero_v3(uv_max_y);
   uv_max_y[0] = 0.0f;
   uv_max_y[1] = height;
-  mul_v3_m4v3(r_add_y, transform_matrix, uv_max_y);
-  sub_v2_v2(r_add_y, start_uv);
-  mul_v2_fl(r_add_y, 1.0f / height);
+  mul_v3_m4v3(r_add_y_temp, transform_matrix, uv_max_y);
+  sub_v2_v2(r_add_y_temp, start_uv);
+  mul_v2_fl(r_add_y_temp, 1.0f / height);
+  copy_v2_v2(r_add_y, r_add_y_temp);
 }
 
 typedef void (*InterpolationColorFunction)(



More information about the Bf-blender-cvs mailing list