mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-24 05:49:58 +00:00
Atrac buffer validate RIFF header
This commit is contained in:
parent
62d1948b70
commit
9722e1eb03
@ -57,6 +57,7 @@
|
||||
#define PSP_MODE_AT_3_PLUS 0x00001000
|
||||
#define PSP_MODE_AT_3 0x00001001
|
||||
|
||||
const int RIFF_CHUNK_MAGIC = 0x46464952;
|
||||
const int FMT_CHUNK_MAGIC = 0x20746D66;
|
||||
const int DATA_CHUNK_MAGIC = 0x61746164;
|
||||
const int SMPL_CHUNK_MAGIC = 0x6C706D73;
|
||||
@ -411,6 +412,11 @@ int Atrac::Analyze() {
|
||||
|
||||
// TODO: Validate stuff.
|
||||
|
||||
if (Memory::Read_U32(first.addr) != RIFF_CHUNK_MAGIC) {
|
||||
ERROR_LOG(ME, "Atrac buffer invalid RIFF header: %08x", first.addr);
|
||||
return ATRAC_ERROR_UNKNOWN_FORMAT;
|
||||
}
|
||||
|
||||
// RIFF size excluding chunk header.
|
||||
first.filesize = Memory::Read_U32(first.addr + 4) + 8;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user