summaryrefslogtreecommitdiff
path: root/src/newgrf_spritegroup.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2018-10-14 23:36:14 +0100
committerfrosch <github@elsenhans.name>2018-10-31 12:41:49 +0100
commitb5028efc1fa862073c908c435f84098ccd246fdc (patch)
treeec0a38f99b8885e4d977bb4e5ece8fd37d96a8e3 /src/newgrf_spritegroup.cpp
parent52ed3bcbaa88717ab50f71150ed9fc0b6af4715a (diff)
downloadopenttd-b5028efc1fa862073c908c435f84098ccd246fdc.tar.xz
Fix: Protect against a few out of bounds or uninitialised usage errors
Diffstat (limited to 'src/newgrf_spritegroup.cpp')
-rw-r--r--src/newgrf_spritegroup.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index 086cbf346..59b845f10 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -154,6 +154,7 @@ static uint32 RotateRight(uint32 val, uint32 rot)
{
/* Do not rotate more than necessary */
rot %= 32;
+ assert(rot > 0);
return (val >> rot) | (val << (32 - rot));
}