It can be triggered by doing a resize at the last frame position with the Esprita.anim or dragging the dragbar right out the window with any YAFA anims.
It can be fixed by insert these lines before line 58 (GetAnimFrame...):
frame=Min(frame,numframes)
frame=Max(frame,1)
However maybe the official fix will be something else.