mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 10:40:01 +01:00
Account for uneven sized chunks by rounding up.
Chunks have an extra pad byte if the size is uneven. This probably isn't happening, but just to be safe.
This commit is contained in:
1 parent
e632b32be2
commit
d0a9813844
1 file changed
+5
@@ -573,6 +573,11 @@ int Atrac::Analyze() {
|
||||
while (first.filesize >= offset + 8 && !bfoundData) {
|
||||
int chunkMagic = Memory::Read_U32(first.addr + offset);
|
||||
u32 chunkSize = Memory::Read_U32(first.addr + offset + 4);
|
||||
// Account for odd sized chunks.
|
||||
if (chunkSize & 1) {
|
||||
WARN_LOG_REPORT_ONCE(oddchunk, ME, "RIFF chunk had uneven size");
|
||||
}
|
||||
chunkSize += (chunkSize & 1);
|
||||
offset += 8;
|
||||
if (chunkSize > first.filesize - offset)
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user