From 5cef1ea3c6a3ed3851c631354bf9168a154179dc Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 13 Jan 2013 11:55:51 +0000 Subject: [PATCH] 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. --- pv/data/logicsnapshot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); -- 2.30.2