diff -urN 10-STYMulator-0.21a_avoid_ambiguous_else/src/stsoundlib/YmMusic.cpp 11-STYMulator-0.21a_protect_loopframe/src/stsoundlib/YmMusic.cpp --- 10-STYMulator-0.21a_avoid_ambiguous_else/src/stsoundlib/YmMusic.cpp 2010-04-21 19:01:44.377500997 +0200 +++ 11-STYMulator-0.21a_protect_loopframe/src/stsoundlib/YmMusic.cpp 2010-04-24 02:07:48.297625418 +0200 @@ -325,6 +325,10 @@ if (bLoop) { currentFrame = loopFrame; + if (currentFrame < 0) + currentFrame = 0; + else if (currentFrame >= nbFrame) + currentFrame = nbFrame - 1; } else {