mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 23:10:10 +01:00
Fix raw .xa validation [Toy Story 2 (PS1)]
This commit is contained in:
parent
6ccceee033
commit
18fcb5fed7
@ -752,7 +752,7 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_RWAV, "Nintendo RWAV header"},
|
||||
{meta_CWAV, "Nintendo CWAV header"},
|
||||
{meta_FWAV, "Nintendo FWAV header"},
|
||||
{meta_XA, "Sony XA RIFF header"},
|
||||
{meta_XA, "Sony XA header"},
|
||||
{meta_PS2_RXWS, "Sony RXWS header"},
|
||||
{meta_PS2_RAW, ".int PCM raw header"},
|
||||
{meta_PS2_OMU, "Alter Echo OMU Header"},
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "../layout/layout.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* CD-XA - from Sony PS1 CDs */
|
||||
/* CD-XA - from Sony PS1 and Philips CD-i CD audio */
|
||||
VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
@ -10,6 +10,7 @@ VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) {
|
||||
int is_blocked;
|
||||
size_t file_size = get_streamfile_size(streamFile);
|
||||
|
||||
|
||||
/* checks
|
||||
* .xa: common, .str: sometimes (mainly videos)
|
||||
* .adp: Phantasy Star Collection (SAT) raw XA */
|
||||
@ -53,7 +54,7 @@ VGMSTREAM * init_vgmstream_xa(STREAMFILE *streamFile) {
|
||||
for (i = 0; i < (sector_size/block_size); i++) {
|
||||
/* XA headers checks: filter indexes should be 0..3, and shifts 0..C */
|
||||
for (j = 0; j < 16; j++) {
|
||||
uint8_t header = (uint8_t)read_8bit(test_offset + i, streamFile);
|
||||
uint8_t header = (uint8_t)read_8bit(test_offset + j, streamFile);
|
||||
if (((header >> 4) & 0xF) > 0x03)
|
||||
goto fail;
|
||||
if (((header >> 0) & 0xF) > 0x0c)
|
||||
|
Loading…
Reference in New Issue
Block a user