From 59e228439fa073a81ebad575c0e191d2d8a88ee2 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 18 Jul 2021 11:05:33 -0700 Subject: [PATCH] cache: ignore shifts beyond map size Fixes crash --- app/render/framehashcache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/render/framehashcache.cpp b/app/render/framehashcache.cpp index 6317e4a7a..5f0b9a921 100644 --- a/app/render/framehashcache.cpp +++ b/app/render/framehashcache.cpp @@ -256,6 +256,10 @@ void FrameHashCache::ShiftEvent(const rational &from, const rational &to) int64_t to_ts = ToTimestamp(to); int64_t from_ts = ToTimestamp(from); + if (from_ts >= GetMapSize()) { + return; + } + if (diff_is_negative) { // We're moving the frames starting at `from` backwards to where `to` is if (to_ts < GetMapSize()) {