diff layer/Colour3DPlotLayer.cpp @ 843:db0759e4c6c3

Fix some (probably benign) uninitialised members (from coverity scan)
author Chris Cannam
date Wed, 03 Sep 2014 11:31:09 +0100
parents 2d4af227fd32
children 3ca3b8fbbcee
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Tue Sep 02 16:18:26 2014 +0100
+++ b/layer/Colour3DPlotLayer.cpp	Wed Sep 03 11:31:09 2014 +0100
@@ -109,7 +109,7 @@
 void
 Colour3DPlotLayer::cacheInvalid(int startFrame, int endFrame)
 {
-    if (!m_cache) return;
+    if (!m_cache || !m_model) return;
 
     int modelResolution = m_model->getResolution();
     int start = startFrame / modelResolution;
@@ -1529,7 +1529,9 @@
                 int sx0i = int(sx0 + epsilon);
                 if (sx0i >= sw) break;
 
-                float a, b, value;
+                float a = float(sourceLine[sx0i]);
+                float b = a;
+                float value;
 
                 float sx1 = sxa[x*2+1];
                 if (sx1 > sx0 + 1.f) {