Fix issue 409: Infinite loop upon creating new sprite with a loop section set

Fix app::calculate_next_frame() to check that the loop section is correctly
inside the available sprite frames range [0, nframes)
This commit is contained in:
David Capello 2014-06-12 23:27:38 -03:00
parent 712d48245b
commit b1843f8f7a

View File

@ -39,8 +39,8 @@ raster::FrameNumber calculate_next_frame(
if (docSettings->getLoopAnimation()) {
FrameNumber loopBegin, loopEnd;
docSettings->getLoopRange(&loopBegin, &loopEnd);
if (loopBegin < first) loopBegin = first;
if (loopEnd > last) loopEnd = last;
loopBegin = MID(first, loopBegin, last);
loopEnd = MID(first, loopEnd, last);
first = loopBegin;
last = loopEnd;