[subset] clamp distance to prevent shifting outside of the limits of int64.
Fixes https://oss-fuzz.com/testcase-detail/4961171477233664.
This commit is contained in:
parent
fcacd17748
commit
71d6d15600
@ -75,7 +75,8 @@ struct graph_t
|
|||||||
// setting distance = 0 which will force to sort immediately after
|
// setting distance = 0 which will force to sort immediately after
|
||||||
// it's parent where possible.
|
// it's parent where possible.
|
||||||
|
|
||||||
int64_t modified_distance = distance + distance_modifier ();
|
int64_t modified_distance =
|
||||||
|
hb_min (hb_max(distance + distance_modifier (), 0), 0x7FFFFFFFFF);
|
||||||
return (modified_distance << 24) | (0x00FFFFFF & order);
|
return (modified_distance << 24) | (0x00FFFFFF & order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user