From f054d9856901b12bc556f8e1918daaa34e5f1864 Mon Sep 17 00:00:00 2001 From: DreamSourceLab Date: Mon, 12 Jun 2023 20:30:35 +0800 Subject: [PATCH] fix get_pre_edge error when index less than _loop_offset --- DSView/pv/data/logicsnapshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSView/pv/data/logicsnapshot.cpp b/DSView/pv/data/logicsnapshot.cpp index f55fdccd..30483e42 100644 --- a/DSView/pv/data/logicsnapshot.cpp +++ b/DSView/pv/data/logicsnapshot.cpp @@ -834,7 +834,7 @@ bool LogicSnapshot::get_pre_edge(uint64_t &index, bool last_sample, bool flag = get_pre_edge_self(index, last_sample, min_length, sig_index); - index -= _loop_offset; + index = (index < _loop_offset) ? 0 : index - _loop_offset; _ring_sample_count -= _loop_offset; return flag; }