summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-05-10 17:27:34 +0000
committerpeter1138 <peter1138@openttd.org>2010-05-10 17:27:34 +0000
commit92042c62375fc0b2930dd35953f9c2ed32b40780 (patch)
tree03f456960d386b1923776cb3ea4b22cd32f014d4 /src
parenta8fa3dd3ce76e209ec421f825da631edf7e9fd75 (diff)
downloadopenttd-92042c62375fc0b2930dd35953f9c2ed32b40780.tar.xz
(svn r19782) -Fix [FS#3828]: NULL pointer deference when testing relative scope *action2 on an unbuilt engine.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index ff22015dc..fcb4c764c 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -374,6 +374,7 @@ static inline const Vehicle *GRV(const ResolverObject *object)
case VSG_SCOPE_SELF: return object->u.vehicle.self;
case VSG_SCOPE_PARENT: return object->u.vehicle.parent;
case VSG_SCOPE_RELATIVE: {
+ if (object->u.vehicle.self == NULL) return NULL;
const Vehicle *v = NULL;
switch (GB(object->count, 6, 2)) {
default: NOT_REACHED();