From 8cda4a8d90c771bc677096ac944ea1a9605da696 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Thu, 31 Jan 2008 14:47:14 +0000 Subject: [PATCH] comctl32: In certain circumstances, native comctl32's animation control accepts negative start positions for the ACM_PLAY message. These circumstances seems to be after a seek is performed, but we play it safe and allow negative start positions to be treated as zero always. --- dlls/comctl32/animate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index d6c84daaadf..83433899dd5 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -434,6 +434,10 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR TRACE("(repeat=%d from=%d to=%d);\n", infoPtr->nLoop, infoPtr->nFromFrame, infoPtr->nToFrame); + if (infoPtr->nFromFrame >= infoPtr->mah.dwTotalFrames && + (SHORT)infoPtr->nFromFrame < 0) + infoPtr->nFromFrame = 0; + if (infoPtr->nFromFrame > infoPtr->nToFrame || infoPtr->nToFrame >= infoPtr->mah.dwTotalFrames) return FALSE;