mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
Codefix: Avoid divide by 0 in div/mod type varaction2 adjusts (#13123)
This commit is contained in:
parent
23e252ad40
commit
f5a6a31e4a
@ -5254,6 +5254,7 @@ static void NewSpriteGroup(ByteReader &buf)
|
||||
if (adjust.type != DSGA_TYPE_NONE) {
|
||||
adjust.add_val = buf.ReadVarSize(varsize);
|
||||
adjust.divmod_val = buf.ReadVarSize(varsize);
|
||||
if (adjust.divmod_val == 0) adjust.divmod_val = 1; // Ensure that divide by zero cannot occur
|
||||
} else {
|
||||
adjust.add_val = 0;
|
||||
adjust.divmod_val = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user