Fix possible division by 0 in radius calculation
This commit is contained in:
parent
9db8b76473
commit
c01f81b692
@ -412,6 +412,9 @@ static int layout_get_height(struct colored_layout *cl)
|
|||||||
*/
|
*/
|
||||||
static int frame_internal_radius (int r, int w, int h)
|
static int frame_internal_radius (int r, int w, int h)
|
||||||
{
|
{
|
||||||
|
if (r == 0 || w == 0 || h == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Integer precision scaler, using 1/4 of int size
|
// Integer precision scaler, using 1/4 of int size
|
||||||
const int s = 2 << (8 * sizeof(int) / 4);
|
const int s = 2 << (8 * sizeof(int) / 4);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user