From cd9adbb00a594551b45236cf61cb5b2c50d57df8 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Mon, 23 Feb 2015 14:14:22 +0100 Subject: [PATCH] Initial fix for racing condition in code for detecting first/last page of a comic that could lead to crashes. --- YACReader/render.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/YACReader/render.cpp b/YACReader/render.cpp index 5f311657..155c1a5a 100644 --- a/YACReader/render.cpp +++ b/YACReader/render.cpp @@ -849,7 +849,7 @@ void Render::nextPage() update(); emit pageChanged(currentIndex); } - else + else if (hasLoadedComic() && (currentIndex == numPages()-1)) { emit isLast(); } @@ -873,7 +873,7 @@ void Render::nextDoublePage() update(); emit pageChanged(currentIndex); } - else + else if (hasLoadedComic() && (currentIndex >= numPages()-2)) { emit isLast(); } @@ -894,7 +894,7 @@ void Render::previousPage() update(); emit pageChanged(currentIndex); } - else + else if (hasLoadedComic() && (currentIndex == 0)) { emit isCover(); }