fix for crash in point comparison when one of the arrays is NULL
[blender.git] / source / blender / blenkernel / intern / mask.c
index 97977ca33208b83cc50bd1aa31f055eed7c2ac4e..a152fb900cfe3c6fdb914ceb99cf279150175b3b 100644 (file)
@@ -2215,6 +2215,11 @@ static int mask_points_compare(MaskSplinePoint *points_a, MaskSplinePoint *point
        MaskSplinePoint *point_b = points_b;
        int a = tot_point;
 
+       /* deform points can be NULL */
+       if (point_a == NULL || point_b == NULL) {
+               return ((point_a == NULL) && (point_b == NULL));
+       }
+
        while (a--) {
                if (!mask_point_compare(point_a, point_b)) {
                        return FALSE;