From: Soeren Apel Date: Sun, 8 Apr 2018 18:41:48 +0000 (+0200) Subject: Session: Don't process packets without sample data X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eaa02ef436fb9d8217a94076e1258da47d3cd8e0;p=pulseview.git Session: Don't process packets without sample data --- diff --git a/pv/session.cpp b/pv/session.cpp index bf9e3a2c..cbf24e23 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -1130,6 +1130,11 @@ void Session::feed_in_frame_end() void Session::feed_in_logic(shared_ptr logic) { + if (logic->data_length() == 0) { + qDebug() << "WARNING: Received logic packet with 0 samples."; + return; + } + if (!cur_samplerate_) cur_samplerate_ = device_->read_config(ConfigKey::SAMPLERATE); @@ -1162,6 +1167,11 @@ void Session::feed_in_logic(shared_ptr logic) void Session::feed_in_analog(shared_ptr analog) { + if (analog->num_samples() == 0) { + qDebug() << "WARNING: Received analog packet with 0 samples."; + return; + } + if (!cur_samplerate_) cur_samplerate_ = device_->read_config(ConfigKey::SAMPLERATE);