Correctly use declared song count when parsing data
This commit is contained in:
@@ -475,8 +475,9 @@ function collectSongPositions(data: Uint8Array): SongPosition[] {
|
||||
}
|
||||
|
||||
const availablePositions = Math.max(0, data.length - firstSongPositionOffset);
|
||||
const songCount = Math.min(data[songCountOffset], 99, availablePositions);
|
||||
if (songCount === 1 && data[firstSongPositionOffset] === 1) {
|
||||
const declaredSongCount = data[songCountOffset];
|
||||
const songCount = Math.min(declaredSongCount, 99, availablePositions);
|
||||
if (declaredSongCount === 1 && data[firstSongPositionOffset] === 1) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user