diff --git a/canframemodel.cpp b/canframemodel.cpp index 39eaf30..735236b 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -253,7 +253,7 @@ uint64_t CANFrameModel::getCANFrameVal(int row, Column col) return static_cast(frame.payload().length()); case Column::ASCII: //sort both the same for now case Column::Data: - for (int i = 0; i < frame.payload().length(); i++) temp += (static_cast(frame.payload()[i]) << (56 - (8 * i))); + for (int i = 0; i < std::min(frame.payload().length(), 8); i++) temp += (static_cast(frame.payload()[i]) << (56 - (8 * i))); //qDebug() << temp; return temp; case Column::NUM_COLUMN: