From 954d798b756fcd52ea687fb194e9682b1e950daf Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 30 Mar 2023 11:19:50 +0800 Subject: [PATCH] fix: If the channel data is single, the cahnnel 2 access it cracked --- DSView/pv/view/dsosignal.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/pv/view/dsosignal.cpp index ff080647..eb917049 100644 --- a/DSView/pv/view/dsosignal.cpp +++ b/DSView/pv/view/dsosignal.cpp @@ -1449,6 +1449,12 @@ bool DsoSignal::measure(const QPointF &p) if (_hover_index >= _data->get_sample_count()) return false; + int chan_index = get_index(); + if (_data->has_data(chan_index) == false){ + dsv_err("channel %d have no data.", chan_index); + return false; + } + _hover_point = get_point(_hover_index, _hover_value); _hover_en = true; return true;