From ff2a47e7e67bb77d816503212219a1a486fd8f39 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 26 Sep 2018 09:33:12 -0700 Subject: [PATCH] fix several uninitialized reads --- interface/src/Application.cpp | 1 - interface/src/Application.h | 4 ++-- libraries/entities/src/EntityTreeElement.cpp | 4 ++-- libraries/shared/src/TriangleSet.cpp | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ce51f4b5ce..168f7b4d33 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -996,7 +996,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _enableProcessOctreeThread(true), _lastNackTime(usecTimestampNow()), _lastSendDownstreamAudioStats(usecTimestampNow()), - _aboutToQuit(false), _notifiedPacketVersionMismatchThisDomain(false), _maxOctreePPS(maxOctreePacketsPerSecond.get()), _lastFaceTrackerUpdate(0), diff --git a/interface/src/Application.h b/interface/src/Application.h index eedbdb7622..f7c9d60429 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -560,6 +560,8 @@ private: MainWindow* _window; QElapsedTimer& _sessionRunTimer; + bool _aboutToQuit { false }; + bool _previousSessionCrashed; DisplayPluginPointer _displayPlugin; @@ -651,8 +653,6 @@ private: quint64 _lastNackTime; quint64 _lastSendDownstreamAudioStats; - bool _aboutToQuit; - bool _notifiedPacketVersionMismatchThisDomain; ConditionalGuard _settingsGuard; diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index efe5dafccf..5b71010f75 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -145,7 +145,7 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con bool visibleOnly, bool collidableOnly, QVariantMap& extraInfo, bool precisionPicking) { EntityItemID result; - BoxFace localFace; + BoxFace localFace { UNKNOWN_FACE }; glm::vec3 localSurfaceNormal; if (!canPickIntersect()) { @@ -213,7 +213,7 @@ EntityItemID EntityTreeElement::findDetailedRayIntersection(const glm::vec3& ori // we can use the AABox's ray intersection by mapping our origin and direction into the entity frame // and testing intersection there. float localDistance; - BoxFace localFace; + BoxFace localFace { UNKNOWN_FACE }; glm::vec3 localSurfaceNormal; if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, 1.0f / entityFrameDirection, localDistance, localFace, localSurfaceNormal)) { diff --git a/libraries/shared/src/TriangleSet.cpp b/libraries/shared/src/TriangleSet.cpp index 02a8d458a9..bc2deed863 100644 --- a/libraries/shared/src/TriangleSet.cpp +++ b/libraries/shared/src/TriangleSet.cpp @@ -248,7 +248,7 @@ bool TriangleSet::TriangleTreeCell::findRayIntersection(const glm::vec3& origin, // The distance passed in here is the distance to our bounding box. If !precision, that distance is used { float internalDistance = distance; - BoxFace internalFace; + BoxFace internalFace { UNKNOWN_FACE }; Triangle internalTriangle; if (findRayIntersectionInternal(origin, direction, internalDistance, internalFace, internalTriangle, precision, trianglesTouched, allowBackface)) { bestLocalDistance = internalDistance; @@ -472,4 +472,4 @@ bool TriangleSet::TriangleTreeCell::findParabolaIntersection(const glm::vec3& or triangle = bestLocalTriangle; } return intersects; -} \ No newline at end of file +}