summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-12-13 19:43:57 +0000
committerfrosch <frosch@openttd.org>2008-12-13 19:43:57 +0000
commita5c02ba0a58373d508595ed224fc529fe62e6980 (patch)
treedb4d4e7953535571ae00703c2405703678e5b1c1 /src/newgrf.cpp
parent4b12d83fddd1dd6f01d7de34a098952873a4915a (diff)
downloadopenttd-a5c02ba0a58373d508595ed224fc529fe62e6980.tar.xz
(svn r14674) -Fix (r4965): Check sprite size when executing action 6.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index bc922e156..56ce8f10a 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -3842,7 +3842,7 @@ static void CfgApply(byte *buf, size_t len)
grfmsg(8, "CfgApply: Applying %u bytes from parameter 0x%02X at offset 0x%04X", param_size, param_num, offset);
bool carry = false;
- for (i = 0; i < param_size; i++) {
+ for (i = 0; i < param_size && offset + i < num; i++) {
uint32 value = GetParamVal(param_num + i / 4, NULL);
/* Reset carry flag for each iteration of the variable (only really
* matters if param_size is greater than 4) */