From e41c3ae2fbff6b1de19f4402e83d1b89c9d95e76 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 7 Apr 2022 16:29:31 +0800 Subject: [PATCH] fix: sometimes,after decode task redo, annotation table visit error --- DSView/pv/data/decode/annotationrestable.cpp | 4 +++- DSView/pv/sigsession.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DSView/pv/data/decode/annotationrestable.cpp b/DSView/pv/data/decode/annotationrestable.cpp index 55eeb9c9..3f33f263 100644 --- a/DSView/pv/data/decode/annotationrestable.cpp +++ b/DSView/pv/data/decode/annotationrestable.cpp @@ -126,7 +126,9 @@ int AnnotationResTable::MakeIndex(const std::string &key, AnnotationSourceItem* } AnnotationSourceItem* AnnotationResTable::GetItem(int index){ - assert(index >= 0 && index < m_resourceTable.size()); + if (index < 0 || index >= (int)m_resourceTable.size()){ + assert(false); + } return m_resourceTable[index]; } diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index 094c446b..2ea36451 100755 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -1442,6 +1442,7 @@ void SigSession::rst_decoder(int index) if (trace && trace->create_popup() ){ remove_decode_task(trace); //remove old task + trace->decoder()->clear(); add_decode_task(trace); data_updated(); }