From: Joel Holdsworth Date: Sun, 13 Jan 2013 11:55:51 +0000 (+0000) Subject: Fixed usage of sr_datafeed_logic::length X-Git-Tag: pulseview-0.1.0~167 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=5cef1ea3c6a3ed3851c631354bf9168a154179dc Fixed usage of sr_datafeed_logic::length The length field is a measure of bytes not samples. The previous usage would fail unless the unitsize was set to 1. --- diff --git a/pv/data/logicsnapshot.cpp b/pv/data/logicsnapshot.cpp index 9b3eedd1..5665d35f 100644 --- a/pv/data/logicsnapshot.cpp +++ b/pv/data/logicsnapshot.cpp @@ -60,10 +60,11 @@ void LogicSnapshot::append_payload( const sr_datafeed_logic &logic) { assert(_unit_size == logic.unitsize); + assert((logic.length % _unit_size) == 0); lock_guard lock(_mutex); - append_data(logic.data, logic.length); + append_data(logic.data, logic.length / _unit_size); // Generate the first mip-map from the data append_payload_to_mipmap();