BGE: fix for 2 uses of uninitialized memory - property-sensor and object-color for materials.

This commit is contained in:
Campbell Barton
2012-11-11 10:03:25 +00:00
parent f5df1601d6
commit 47068e88fb
2 changed files with 4 additions and 5 deletions

View File

@@ -152,13 +152,11 @@ bool SCA_PropertySensor::CheckPropertyCondition()
*/
if (result==false && dynamic_cast<CFloatValue *>(orgprop) != NULL) {
float f;
if (EOF == sscanf(m_checkpropval.ReadPtr(), "%f", &f))
{
//error
if (sscanf(m_checkpropval.ReadPtr(), "%f", &f) == 1) {
result = (f == ((CFloatValue *)orgprop)->GetFloat());
}
else {
result = (f == ((CFloatValue *)orgprop)->GetFloat());
/* error */
}
}
/* end patch */

View File

@@ -99,6 +99,7 @@ KX_GameObject::KX_GameObject(
m_bSuspendDynamics(false),
m_bUseObjectColor(false),
m_bIsNegativeScaling(false),
m_objectColor(1.0, 1.0, 1.0, 1.0),
m_bVisible(true),
m_bCulled(true),
m_bOccluder(false),