mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 21:15:11 +00:00
debug wavetables?
This commit is contained in:
parent
d6ae735ffe
commit
bf501cbe88
1 changed files with 5 additions and 1 deletions
|
@ -48,6 +48,7 @@ DivDataErrors DivWavetable::readWaveData(SafeReader& reader, short version) {
|
||||||
char magic[4];
|
char magic[4];
|
||||||
reader.read(magic,4);
|
reader.read(magic,4);
|
||||||
if (memcmp(magic,"WAVE",4)!=0) {
|
if (memcmp(magic,"WAVE",4)!=0) {
|
||||||
|
logV("header is invalid: %c%c%c%c",magic[0],magic[1],magic[2],magic[3]);
|
||||||
return DIV_DATA_INVALID_HEADER;
|
return DIV_DATA_INVALID_HEADER;
|
||||||
}
|
}
|
||||||
reader.readI(); // reserved
|
reader.readI(); // reserved
|
||||||
|
@ -57,7 +58,10 @@ DivDataErrors DivWavetable::readWaveData(SafeReader& reader, short version) {
|
||||||
min=reader.readI();
|
min=reader.readI();
|
||||||
max=reader.readI();
|
max=reader.readI();
|
||||||
|
|
||||||
if (len>256 || min!=0 || max>255) return DIV_DATA_INVALID_DATA;
|
if (len>256 || min!=0 || max>255) {
|
||||||
|
logV("invalid len/min/max: %d %d %d",len,min,max);
|
||||||
|
return DIV_DATA_INVALID_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<len; i++) {
|
for (int i=0; i<len; i++) {
|
||||||
data[i]=reader.readI();
|
data[i]=reader.readI();
|
||||||
|
|
Loading…
Reference in a new issue