Commit f3221fee authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed access to uninitialized memory.

closes #1176



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15679 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8d82d7bb
...@@ -192,15 +192,18 @@ DrawMode::DrawMode(unsigned int _index) ...@@ -192,15 +192,18 @@ DrawMode::DrawMode(unsigned int _index)
modeFlags_.set(_index); modeFlags_.set(_index);
} }
layers_.resize(1); layers_.resize(1);
layers_[0] = DrawModeProperties();
} }
DrawMode::DrawMode() { DrawMode::DrawMode() {
layers_.resize(1); layers_.resize(1);
layers_[0] = DrawModeProperties();
} }
DrawMode::DrawMode( ModeFlagSet _flags ) { DrawMode::DrawMode( ModeFlagSet _flags ) {
modeFlags_ = _flags; modeFlags_ = _flags;
layers_.resize(1); layers_.resize(1);
layers_[0] = DrawModeProperties();
} }
DrawMode::operator bool() const { DrawMode::operator bool() const {
...@@ -276,7 +279,7 @@ DrawMode& DrawMode::operator|=( const DrawMode& _mode2 ) { ...@@ -276,7 +279,7 @@ DrawMode& DrawMode::operator|=( const DrawMode& _mode2 ) {
for (unsigned int i = 0; i < _mode2.getNumLayers(); ++i) for (unsigned int i = 0; i < _mode2.getNumLayers(); ++i)
addLayer(_mode2.getLayer(i)); addLayer(_mode2.getLayer(i));
assert(checkConsistency()); // assert(checkConsistency());
return (*this); return (*this);
} }
...@@ -293,7 +296,7 @@ DrawMode& DrawMode::operator&=( const DrawMode& _mode2 ) { ...@@ -293,7 +296,7 @@ DrawMode& DrawMode::operator&=( const DrawMode& _mode2 ) {
removeLayer(i); removeLayer(i);
} }
assert(checkConsistency()); // assert(checkConsistency());
return (*this); return (*this);
} }
...@@ -497,9 +500,7 @@ const DrawModeProperties* DrawMode::getLayer( unsigned int i ) const { ...@@ -497,9 +500,7 @@ const DrawModeProperties* DrawMode::getLayer( unsigned int i ) const {
void DrawMode::addLayer( const DrawModeProperties* _props ) void DrawMode::addLayer( const DrawModeProperties* _props )
{ {
if (getLayerIndex(_props) < 0) if (getLayerIndex(_props) < 0)
return; layers_.push_back(*_props);
layers_.push_back(*_props);
} }
bool DrawMode::removeLayer( unsigned int _i ) bool DrawMode::removeLayer( unsigned int _i )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment