Crash fix for animated .gifs with zero delay times

This commit is contained in:
Richard Stanway 2012-12-12 10:01:35 -05:00
parent ecd7c37fcf
commit 6d49cf337b

View File

@ -106,6 +106,8 @@ public:
{ {
if(!totalLoops || ++curLoop < totalLoops) if(!totalLoops || ++curLoop < totalLoops)
newFrame = 0; newFrame = 0;
else if (curLoop == totalLoops)
break;
} }
} }
@ -196,7 +198,12 @@ public:
texture = CreateTexture(gif.width, gif.height, GS_RGBA, gif.frame_image, FALSE, FALSE); texture = CreateTexture(gif.width, gif.height, GS_RGBA, gif.frame_image, FALSE, FALSE);
for(UINT i=0; i<gif.frame_count; i++) for(UINT i=0; i<gif.frame_count; i++)
animationTimes << float(gif.frames[i].frame_delay)*0.01f; {
float frameTime = float(gif.frames[i].frame_delay)*0.01f;
if (frameTime == 0.0f)
frameTime = 0.1f;
animationTimes << frameTime;
}
fullSize.x = float(gif.width); fullSize.x = float(gif.width);
fullSize.y = float(gif.height); fullSize.y = float(gif.height);