diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 4d3dbe2b..ebbbfa0d 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -665,8 +665,10 @@ void DisassemblyWidget::on_seekChanged(RVA offset, CutterCore::SeekHistoryType t { if (type == CutterCore::SeekHistoryType::New) { // Erase previous history past this point. - topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1, - topOffsetHistory.end()); + if (topOffsetHistory.size() > topOffsetHistoryPos + 1) { + topOffsetHistory.erase(topOffsetHistory.begin() + topOffsetHistoryPos + 1, + topOffsetHistory.end()); + } topOffsetHistory.push_back(offset); topOffsetHistoryPos = topOffsetHistory.size() - 1; } else if (type == CutterCore::SeekHistoryType::Undo) {