forked from minhngoc25a/freetype2
* src/sdf/ftsdf.c (get_min_distance_line): Minor bug
This commit is contained in:
parent
c8e3c5a420
commit
5cbcab183a
|
@ -1,3 +1,8 @@
|
||||||
|
2020-07-01 Anuj Verma <anujv@iitbhilai.ac.in>
|
||||||
|
|
||||||
|
* src/sdf/ftsdf.c (get_min_distance_line): First check
|
||||||
|
pointer before using or dereferencing them.
|
||||||
|
|
||||||
2020-06-30 Anuj Verma <anujv@iitbhilai.ac.in>
|
2020-06-30 Anuj Verma <anujv@iitbhilai.ac.in>
|
||||||
|
|
||||||
* src/sdf/ftsdf.c: Avoid parentheses if there is only
|
* src/sdf/ftsdf.c: Avoid parentheses if there is only
|
||||||
|
|
|
@ -1014,9 +1014,9 @@
|
||||||
|
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
const FT_Vector a = line->start_pos;
|
FT_Vector a; /* start position */
|
||||||
const FT_Vector b = line->end_pos;
|
FT_Vector b; /* end position */
|
||||||
const FT_Vector p = point;
|
FT_Vector p; /* current point */
|
||||||
|
|
||||||
FT_26D6_Vec line_segment; /* `b' - `a'*/
|
FT_26D6_Vec line_segment; /* `b' - `a'*/
|
||||||
FT_26D6_Vec p_sub_a; /* `p' - `a' */
|
FT_26D6_Vec p_sub_a; /* `p' - `a' */
|
||||||
|
@ -1025,8 +1025,8 @@
|
||||||
FT_16D16 factor; /* factor of the nearest point */
|
FT_16D16 factor; /* factor of the nearest point */
|
||||||
FT_26D6 cross; /* used to determine sign */
|
FT_26D6 cross; /* used to determine sign */
|
||||||
|
|
||||||
FT_16D16_Vec nearest_point; /* point on the line nearest to `point' */
|
FT_16D16_Vec nearest_point; /* `point_on_line' */
|
||||||
FT_16D16_Vec nearest_vector; /* `p' - `nearest_point' */
|
FT_16D16_Vec nearest_vector; /* `p' - `nearest_point' */
|
||||||
|
|
||||||
if ( !line || !out )
|
if ( !line || !out )
|
||||||
{
|
{
|
||||||
|
@ -1040,6 +1040,10 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a = line->start_pos;
|
||||||
|
b = line->end_pos;
|
||||||
|
p = point;
|
||||||
|
|
||||||
line_segment.x = b.x - a.x;
|
line_segment.x = b.x - a.x;
|
||||||
line_segment.y = b.y - a.y;
|
line_segment.y = b.y - a.y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue