Date: Fri, 20 Feb 2015 06:53:38 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r379412 - in head/games/cube: . files Message-ID: <201502200653.t1K6rcDR080860@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Fri Feb 20 06:53:37 2015 New Revision: 379412 URL: https://svnweb.freebsd.org/changeset/ports/379412 QAT: https://qat.redports.org/buildarchive/r379412/ Log: - 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] Added: head/games/cube/files/patch-entities.cpp (contents, props changed) head/games/cube/files/patch-physics.cpp (contents, props changed) head/games/cube/files/patch-protos.h (contents, props changed) head/games/cube/files/patch-rendermd2.cpp (contents, props changed) Modified: head/games/cube/Makefile Modified: head/games/cube/Makefile ============================================================================== --- head/games/cube/Makefile Fri Feb 20 05:15:17 2015 (r379411) +++ head/games/cube/Makefile Fri Feb 20 06:53:37 2015 (r379412) @@ -3,7 +3,7 @@ PORTNAME= cube DISTVERSION= 2005_08_29 -PORTREVISION= 14 +PORTREVISION= 15 CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${DISTVERSION} DISTFILES= ${CUBE_DATA} ${CUBE_SRC} @@ -11,9 +11,10 @@ DISTFILES= ${CUBE_DATA} ${CUBE_SRC} MAINTAINER= ports@FreeBSD.org COMMENT= OpenGL 3D FPS (first person shooter) game -BUILD_DEPENDS= ${LOCALBASE}/lib/libenet.a:${PORTSDIR}/net/enet +LIB_DEPENDS= libenet.so:${PORTSDIR}/net/enet USES= dos2unix gmake +EXTRACT_AFTER_ARGS=--exclude enet ALL_TARGET= # USE_XORG= x11 Added: head/games/cube/files/patch-entities.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/cube/files/patch-entities.cpp Fri Feb 20 06:53:37 2015 (r379412) @@ -0,0 +1,15 @@ +--- entities.cpp.orig 2015-02-14 01:42:48.128349000 +0100 ++++ entities.cpp 2015-02-14 01:44:19.309526000 +0100 +@@ -25,9 +25,9 @@ + entity &e = ents[i]; + if(e.type==MAPMODEL) + { +- mapmodelinfo &mmi = getmminfo(e.attr2); +- if(!&mmi) continue; +- rendermodel(mmi.name, 0, 1, e.attr4, (float)mmi.rad, e.x, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi.snap); ++ mapmodelinfo *mmi = getmminfo(e.attr2); ++ if(!mmi) continue; ++ rendermodel(mmi->name, 0, 1, e.attr4, (float)mmi->rad, e.x, (float)S(e.x, e.y)->floor+mmi->zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi->snap); + } + else + { Added: head/games/cube/files/patch-physics.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/cube/files/patch-physics.cpp Fri Feb 20 06:53:37 2015 (r379412) @@ -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)<r && fabs(e.y-d->o.y)<r) + { +- float mmz = (float)(S(e.x, e.y)->floor+mmi.zoff+e.attr3); ++ float mmz = (float)(S(e.x, e.y)->floor+mmi->zoff+e.attr3); + if(d->o.z-d->eyeheight<mmz) { if(mmz<hi) hi = mmz; } +- else if(mmz+mmi.h>lo) lo = mmz+mmi.h; ++ else if(mmz+mmi->h>lo) lo = mmz+mmi->h; + }; + }; + }; Added: head/games/cube/files/patch-protos.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/cube/files/patch-protos.h Fri Feb 20 06:53:37 2015 (r379412) @@ -0,0 +1,11 @@ +--- protos.h.orig 2015-02-14 01:31:41.352230000 +0100 ++++ protos.h 2015-02-14 01:39:01.934630000 +0100 +@@ -192,7 +192,7 @@ + + // rendermd2 + extern void rendermodel(char *mdl, int frame, int range, int tex, float rad, float x, float y, float z, float yaw, float pitch, bool teammate, float scale, float speed, int snap = 0, int basetime = 0); +-extern mapmodelinfo &getmminfo(int i); ++extern mapmodelinfo *getmminfo(int i); + + // server + extern void initserver(bool dedicated, int uprate, char *sdesc, char *ip, char *master, char *passwd, int maxcl); Added: head/games/cube/files/patch-rendermd2.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/cube/files/patch-rendermd2.cpp Fri Feb 20 06:53:37 2015 (r379412) @@ -0,0 +1,11 @@ +--- rendermd2.cpp.orig 2015-02-14 01:31:41.354388000 +0100 ++++ rendermd2.cpp 2015-02-14 01:39:38.592584000 +0100 +@@ -234,7 +234,7 @@ + + void mapmodelreset() { mapmodels.setsize(0); }; + +-mapmodelinfo &getmminfo(int i) { return i<mapmodels.length() ? mapmodels[i]->mmi : *(mapmodelinfo *)0; }; ++mapmodelinfo *getmminfo(int i) { return i<mapmodels.length() ? &mapmodels[i]->mmi : 0; }; + + COMMAND(mapmodel, ARG_5STR); + COMMAND(mapmodelreset, ARG_NONE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502200653.t1K6rcDR080860>