From 239aad1febdbc73f030817b5793f957b233ad9f5 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Wed, 23 Sep 2015 21:31:02 -0400 Subject: [PATCH] Fix a bug where a faulty DBC file could crash the DBC editor --- dbcsignaleditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbcsignaleditor.cpp b/dbcsignaleditor.cpp index 40d4d09..6f439f7 100644 --- a/dbcsignaleditor.cpp +++ b/dbcsignaleditor.cpp @@ -373,8 +373,9 @@ void DBCSignalEditor::fillSignalForm(DBC_SIGNAL *sig) int byt = startBit / 8; bitpattern[byt] |= 1 << (startBit % 8); size--; - if ((startBit % 8) == 0) startBit += 15; + if ((startBit % 8) == 0) startBit += 15; else startBit--; + if (startBit > 63) startBit = 63; } }