Skip to content

Commit 21107b4

Browse files
committed
Account for div by 0
1 parent 0ded791 commit 21107b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/r_skydefs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool ParseSkyTex(cJSON *json, skytex_t *out)
8383
out->scrollx = (fixed_t)(scrollx->valuedouble * (1.0 / TICRATE) * FRACUNIT);
8484
out->scrolly = (fixed_t)(scrolly->valuedouble * (1.0 / TICRATE) * FRACUNIT);
8585
out->scalex = (fixed_t)(scalex->valuedouble * FRACUNIT);
86-
out->scaley = (fixed_t)(1.0 / scaley->valuedouble * FRACUNIT);
86+
out->scaley = (scaley->valuedouble ? (fixed_t)(1.0 / scaley->valuedouble * FRACUNIT) : FRACUNIT);
8787
return true;
8888
}
8989

0 commit comments

Comments
 (0)