mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-17 19:19:16 +01:00
Reject .wem with excess/incorrect data
This commit is contained in:
parent
567c0af18e
commit
6fb54c3429
@ -767,6 +767,7 @@ static int parse_wwise(STREAMFILE* sf, wwise_header* ww) {
|
||||
/* parse chunks (reads once linearly) */
|
||||
{
|
||||
chunk_t rc = {0};
|
||||
uint32_t file_size = get_streamfile_size(sf);;
|
||||
|
||||
/* chunks are even-aligned and don't need to add padding byte, unlike real RIFFs */
|
||||
rc.be_size = ww->big_endian;
|
||||
@ -819,6 +820,13 @@ static int parse_wwise(STREAMFILE* sf, wwise_header* ww) {
|
||||
/* "JUNK": optional padding for aligment (0-size JUNK exists too) */
|
||||
/* "akd ": extra info for Wwise? (wave peaks/loudness/HDR envelope?) */
|
||||
default:
|
||||
/* mainly for incorrectly ripped wems, but should allow truncated wems
|
||||
* (could also check that fourcc is ASCII) */
|
||||
if (rc.offset + rc.size > file_size) {
|
||||
vgm_logi("WWISE: broken .wem (bad extract?)\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user