summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-07-30 09:07:34 +0200
committerlouis <louis.braun@gmx.de>2016-07-30 09:07:34 +0200
commitdddb273526be87c8a2e235410ce0738db161d6f6 (patch)
tree033cd8e7a83e1cb469f7dc98942586f8c3ce0a04
parentb8d055f56824ffdccea658edcf71193477717f89 (diff)
downloadvdr-plugin-skindesigner-dddb273526be87c8a2e235410ce0738db161d6f6.tar.gz
vdr-plugin-skindesigner-dddb273526be87c8a2e235410ce0738db161d6f6.tar.bz2
fixed crash using too small list shifttimes
-rw-r--r--coreengine/animation.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreengine/animation.c b/coreengine/animation.c
index 8f7159f..fc4393f 100644
--- a/coreengine/animation.c
+++ b/coreengine/animation.c
@@ -305,6 +305,7 @@ void cShifter::Init(void) {
mode = (eShiftMode)shiftable->ShiftMode();
shiftable->ShiftPositions(&start, &end);
int steps = (double)shifttime / (double)frametime;
+ if (steps <= 0) steps = 1;
float percentFast = 33.3f;
float distanceFast = 85.0f;
stepsFast = (float)steps * percentFast / 100.0f;
@@ -400,6 +401,7 @@ cListShifter::cListShifter(cListShiftable *shiftable) {
distance = shiftable->ShiftDistance();
orientation = shiftable->ShiftOrientation();
int steps = (double)shifttime / (double)frametime;
+ if (steps <= 0) steps = 1;
step = distance / steps;
shiftin = true;
fromtop = true;