mirror of
https://github.com/YACReader/yacreader
synced 2025-07-20 05:54:39 -04:00
Fix bug in Render::nextDoublePage() function that could lead to segfault if the last page is a double page. Also fixes related bug that could lead to advancing beyond the actual page count.
This commit is contained in:
@ -850,12 +850,21 @@ void Render::nextPage()
|
||||
emit pageChanged(currentIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit isLast();
|
||||
}
|
||||
}
|
||||
void Render::nextDoublePage()
|
||||
{
|
||||
int nextPage;
|
||||
nextPage = currentIndex+2;
|
||||
if (currentIndex +2 < (int)comic->numPages())
|
||||
{
|
||||
nextPage = currentIndex+2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextPage = currentIndex;
|
||||
}
|
||||
if(currentIndex != nextPage)
|
||||
{
|
||||
comic->setIndex(nextPage);
|
||||
@ -864,6 +873,10 @@ void Render::nextDoublePage()
|
||||
update();
|
||||
emit pageChanged(currentIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit isLast();
|
||||
}
|
||||
}
|
||||
|
||||
//si se solicita la p<>gina anterior, se calcula cu<63>l debe ser en funci<63>n de si se lee en modo a doble p<>gina o no.
|
||||
@ -882,7 +895,9 @@ void Render::previousPage()
|
||||
emit pageChanged(currentIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit isCover();
|
||||
}
|
||||
}
|
||||
|
||||
void Render::previousDoublePage()
|
||||
|
Reference in New Issue
Block a user