avfilter/vf_huesaturation: skip the luminance shear when the luminance vector is zero

Found-by: zhang xingxing
Fixes: float division by 0
Fixes: WgQdanA8nq8x
Fixes: swarm-Division-by-zero-in-hue-rotation-with-zero-weights-bda2e7
This commit is contained in:
zhang xingxing authored and michaelni committed 2026-09-28 03:45:08 +00:00
1 parent 2ff5405601
commit 89909a18c1
1 file changed
+2 -2
+2 -2
View File
@@ -321,8 +321,8 @@ static void hue_rotate_matrix(float matrix[4][4], float rotation,
y_rotate_matrix(matrix, yrs, yrc);
transform_point(matrix, rlw, glw, blw, &lx, &ly, &lz);
zsx = lx / lz;
zsy = ly / lz;
zsx = lz ? lx / lz : 0.f;
zsy = lz ? ly / lz : 0.f;
z_shear_matrix(matrix, zsx, zsy);
zrs = sinf(rotation * M_PI / 180.f);