1
0
Fork 0

Codefix: Avoid divide by 0 in div/mod type varaction2 adjusts

pull/13123/head
Jonathan G Rennison 2024-11-25 17:16:57 +00:00
parent a3437df7b7
commit 268fab7356
1 changed files with 1 additions and 0 deletions

View File

@ -5254,6 +5254,7 @@ static void NewSpriteGroup(ByteReader &buf)
if (adjust.type != DSGA_TYPE_NONE) { if (adjust.type != DSGA_TYPE_NONE) {
adjust.add_val = buf.ReadVarSize(varsize); adjust.add_val = buf.ReadVarSize(varsize);
adjust.divmod_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 { } else {
adjust.add_val = 0; adjust.add_val = 0;
adjust.divmod_val = 0; adjust.divmod_val = 0;