Skip to content

Commit a117c89

Browse files
committed
Prevent crash if Chase/Cycle custom pattern is selected but pattern is empty
1 parent bd9140d commit a117c89

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/channeltester/RGBChase.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int TestPatternRGBChase::SetupTest(void) {
6767
}
6868

6969
// Make sure we have a valid set of triplets
70-
while (m_colorPattern.size() % 3)
70+
while (m_colorPattern.size() < 3 || m_colorPattern.size() % 3)
7171
m_colorPattern.push_back(0);
7272

7373
char* c = m_testData;

‎src/channeltester/RGBCycle.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int TestPatternRGBCycle::SetupTest(void) {
6464
}
6565

6666
// Make sure we have a valid set of triplets
67-
while (m_colorPattern.size() % 3) {
67+
while (m_colorPattern.size() < 3 || m_colorPattern.size() % 3) {
6868
m_colorPattern.push_back(0);
6969
}
7070

0 commit comments

Comments
 (0)