Added a sanity check to LogicSignal::paint
authorJoel Holdsworth <joel@airwebreathe.org.uk>
Sun, 16 Sep 2012 16:25:54 +0000 (17:25 +0100)
committerJoel Holdsworth <joel@airwebreathe.org.uk>
Sun, 30 Sep 2012 19:28:16 +0000 (20:28 +0100)
logicsignal.cpp

index 8d2d00453fd38ed608a7edd08844a896e30a9d34..c42a610fb1c9c30fac8dd73e5b306b0340823570 100644 (file)
@@ -89,6 +89,7 @@ void LogicSignal::paint(QPainter &p, const QRect &rect, double scale,
                min(max((int64_t)floor(start), (int64_t)0), last_sample),
                min(max((int64_t)ceil(end), (int64_t)0), last_sample),
                samples_per_pixel, _probe_index);
                min(max((int64_t)floor(start), (int64_t)0), last_sample),
                min(max((int64_t)ceil(end), (int64_t)0), last_sample),
                samples_per_pixel, _probe_index);
+       assert(edges.size() >= 2);
 
        // Paint the edges
        const unsigned int edge_count = edges.size() - 2;
 
        // Paint the edges
        const unsigned int edge_count = edges.size() - 2;