From 6047e60d752345fe4b73b22da27be4656e6d09df Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 20 Feb 2015 06:53:37 +0000 Subject: - Fix invalid dereferencing of null reference which causes startup crash for cube_client when built with clang 3.6 + -O1 or higher [1] - Properly track libenet dependency [2] PR: 197604 [1] PR: 197605 [2] Submitted by: dim [1] --- games/cube/files/patch-physics.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 games/cube/files/patch-physics.cpp (limited to 'games/cube/files/patch-physics.cpp') diff --git a/games/cube/files/patch-physics.cpp b/games/cube/files/patch-physics.cpp new file mode 100644 index 000000000000..bc4cb6842d10 --- /dev/null +++ b/games/cube/files/patch-physics.cpp @@ -0,0 +1,22 @@ +--- physics.cpp.orig 2015-02-14 01:31:41.351723000 +0100 ++++ physics.cpp 2015-02-14 01:40:28.770647000 +0100 +@@ -46,14 +46,14 @@ + { + entity &e = ents[i]; + if(e.type!=MAPMODEL) continue; +- mapmodelinfo &mmi = getmminfo(e.attr2); +- if(!&mmi || !mmi.h) continue; +- const float r = mmi.rad+d->radius; ++ mapmodelinfo *mmi = getmminfo(e.attr2); ++ if(!mmi || !mmi->h) continue; ++ const float r = mmi->rad+d->radius; + if(fabs(e.x-d->o.x)o.y)floor+mmi.zoff+e.attr3); ++ float mmz = (float)(S(e.x, e.y)->floor+mmi->zoff+e.attr3); + if(d->o.z-d->eyeheightlo) lo = mmz+mmi.h; ++ else if(mmz+mmi->h>lo) lo = mmz+mmi->h; + }; + }; + }; -- cgit v1.2.3