diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-10-22 15:20:26 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-10-22 15:31:04 +0300 |
commit | 269f4a3024f05378a2305b15be41d35e867dae51 (patch) | |
tree | 10cec241377b2cf63b02c748f1dd5b5d45f056fb /source/blender/imbuf | |
parent | ab1909fe06b0d8c1d5eee4824fb19413e0de1b96 (diff) |
Fix VSE left crop not working
Caused by using 3D math on 2D vectors, violating memory boundaries.
Use temporary float[3] variable.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/imageprocess.c | 16 |
1 files changed, 10 insertions, 6 deletions
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)( |