Merge pull request #750 from MaximeWack/master

Fix possible division by zero in radius calculation.
This commit is contained in:
Nikos Tsipinakis 2020-08-15 18:47:24 +03:00 committed by GitHub
commit ca6ce6868e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,7 +412,7 @@ static int layout_get_height(struct colored_layout *cl)
*/
static int frame_internal_radius (int r, int w, int h)
{
if (r == 0 || w == 0 || h == 0)
if (r == 0 || h + (w - r) * 2 == 0)
return 0;
// Integer precision scaler, using 1/4 of int size