VorbisResidue control flow fix

This commit is contained in:
Alex Iadicicco 2022-12-09 20:26:37 -08:00 committed by Alexis King
parent ffcc94db96
commit 4659116a2e

View File

@ -52,7 +52,8 @@ public final class VorbisResidue {
final int[] classes = new int[partitionCount];
for (int pass = 0; pass < 8; ++pass) {
for (int part = 0; part < partitionCount; ++part) {
int part = 0;
while (part < partitionCount) {
if (pass == 0) {
int value = VorbisFormat.codebooks[this.classbook].decodeScalar();
for (int j = cbDim - 1; j >= 0; --j) {
@ -66,10 +67,8 @@ public final class VorbisResidue {
for (int dim = 0; dim < cbDim; ++dim) {
int cls = classes[part];
final int bookIndex = this.books[cls * 8 + pass];
if (bookIndex < 0) {
continue;
}
if (bookIndex >= 0) {
final int offset = this.begin + part * this.partitionSize;
final VorbisCodebook book = VorbisFormat.codebooks[bookIndex];
@ -92,6 +91,12 @@ public final class VorbisResidue {
}
}
}
++part;
if (part >= partitionCount) {
break;
}
}
}
}