Skip to content

Commit b3e14e1

Browse files
committed
More sanitization on the saving compression logic.
1 parent 450cb6b commit b3e14e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Simfile/SaveSm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,12 @@ static bool GetSectionCompression(const char* section, int width, std::list<uint
480480
int lcm = 1;
481481
for (it = quantVec.begin(); it != quantVec.end(); it++)
482482
{
483-
if (*it <= 0)
483+
if (*it <= 0 || *it > 192)
484484
{
485+
// If there's a quantization error assume nothing
485486
error = true;
486-
continue;
487+
lcm = ROWS_PER_NOTE_SECTION;
488+
break;
487489
}
488490
lcm = lcm * *it / gcd(lcm, *it);
489491
if (lcm > ROWS_PER_NOTE_SECTION)

0 commit comments

Comments
 (0)