From: Soeren Apel Date: Mon, 8 Oct 2018 21:54:17 +0000 (+0200) Subject: LogicSegment: Check upper bound when performing edge search X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=8e9e525e01e9cb4d05912a7adce0e6f2f910b90a;hp=daeba21f166d5b8392c22e551733730f7765be92 LogicSegment: Check upper bound when performing edge search --- 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;