Skip to content

Commit 637dcf9

Browse files
committed
fix #376 "vector's iterator dereference out of range"
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
1 parent 8bc0b8b commit 637dcf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openhantek/src/post/graphgenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void GraphGenerator::generateGraphsTYvoltage( PPresult *result ) {
143143
graphVoltage.clear(); // remove all previous dots and fill in new trace as GL_LINE_STRIP
144144
graphHistogram.clear(); // remove all previous line and fill in new histo as GL_LINES
145145
unsigned bins[ int( binsPerDiv * DIVS_VOLTAGE ) ] = { 0 };
146-
for ( unsigned int position = unsigned( leftmostPosition ); position < dotsOnScreen && sampleIterator < sampleEnd;
146+
for ( unsigned int position = unsigned( leftmostPosition ); position < dotsOnScreen && sampleIterator < sampleEnd - 1;
147147
++position ) {
148148
double x = double( MARGIN_LEFT + position * horizontalFactor );
149149
double y_1 = *sampleIterator++ / gain + offset;

0 commit comments

Comments
 (0)