From 8e9e525e01e9cb4d05912a7adce0e6f2f910b90a Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Mon, 8 Oct 2018 23:54:17 +0200 Subject: [PATCH 1/1] LogicSegment: Check upper bound when performing edge search --- pv/data/logicsegment.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index 2f69e02d..8f5eab67 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -371,6 +371,9 @@ void LogicSegment::get_subsampled_edges( void LogicSegment::get_surrounding_edges(vector &dest, uint64_t origin_sample, float min_length, int sig_index) { + if (origin_sample >= sample_count_) + return; + // Put the edges vector on the heap, it can become quite big until we can // use a get_subsampled_edges() implementation that searches backwards vector* edges = new vector; -- 2.30.2