From: Soeren Apel Date: Fri, 30 Mar 2018 21:03:28 +0000 (+0200) Subject: Really fix #1125 (and maybe #1139) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4bd0ecb8d08b655a4e2a1d60b3166e97b290475c;p=pulseview.git Really fix #1125 (and maybe #1139) --- diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index 3595840e..43d1175d 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -277,7 +277,7 @@ void AnalogSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp) paint_grid(p, y, pp.left(), pp.right()); shared_ptr segment = get_analog_segment_to_paint(); - if (!segment) + if (!segment || (segment->get_sample_count() == 0)) return; const double pixels_offset = pp.pixels_offset(); @@ -538,7 +538,7 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp) const float low_offset = y + nh - signal_margin - 0.5f; shared_ptr segment = get_logic_segment_to_paint(); - if (!segment) + if (!segment || (segment->get_sample_count() == 0)) return; double samplerate = segment->samplerate(); diff --git a/pv/views/trace/logicsignal.cpp b/pv/views/trace/logicsignal.cpp index 759f8588..10a5bd4a 100644 --- a/pv/views/trace/logicsignal.cpp +++ b/pv/views/trace/logicsignal.cpp @@ -193,7 +193,7 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp) const float low_offset = y + 0.5f; shared_ptr segment = get_logic_segment_to_paint(); - if (!segment) + if (!segment || (segment->get_sample_count() == 0)) return; double samplerate = segment->samplerate();