summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-23 18:08:15 +0000
committerrubidium <rubidium@openttd.org>2013-11-23 18:08:15 +0000
commitc035a9531bc90368f35eba671c463956c7886075 (patch)
treee19e9b58b11d91a50191bdc75630f7b140f56a21
parentd18852170b99e6cd20a23ef7305cecd7b741a808 (diff)
downloadopenttd-c035a9531bc90368f35eba671c463956c7886075.tar.xz
(svn r26067) -Fix: possible NULL dereference when getting NewGRF version
-rw-r--r--src/newgrf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 36cdadf68..9725d9513 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -6578,7 +6578,7 @@ static void ParamSet(ByteReader *buf)
/* Disable the read GRF if it is a static NewGRF. */
DisableStaticNewGRFInfluencingNonStaticNewGRFs(c);
src1 = 0;
- } else if (file == NULL || (c != NULL && c->status == GCS_DISABLED)) {
+ } else if (file == NULL || c == NULL || c->status == GCS_DISABLED) {
src1 = 0;
} else if (src1 == 0xFE) {
src1 = c->version;