From ea3bf9e5e8f2f071405e51b541e455e86f35ab59 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Sun, 9 Apr 2023 19:56:32 -0400 Subject: [PATCH] skip a few parsing steps if the buffer is empty --- platform/qt/dmxwidget/dmxwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/qt/dmxwidget/dmxwidget.cpp b/platform/qt/dmxwidget/dmxwidget.cpp index ee080e8..48b87ea 100644 --- a/platform/qt/dmxwidget/dmxwidget.cpp +++ b/platform/qt/dmxwidget/dmxwidget.cpp @@ -66,6 +66,8 @@ void DmxWidget::parseMessageBuffer() uint16_t length; const int fixed_length = 5; // start + label + 2xlength + end auto fast_forward = [this](int offset = 0) { + if (message_rx_buffer_.isEmpty()) + return false; if (offset == 0) offset = message_rx_buffer_.indexOf(ENTTEC::Pro::START_DELIMITER); if (offset < 0)