input/wav: increase search range for data chunk, report errors

This commit is contained in:
Stefan Brüns 2015-11-24 20:55:14 +01:00 committed by Uwe Hermann
parent 288f8ce23c
commit b944e336d6
1 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,7 @@
#define MIN_DATA_CHUNK_OFFSET 45
/* Expect to find the "data" chunk within this offset from the start. */
#define MAX_DATA_CHUNK_OFFSET 256
#define MAX_DATA_CHUNK_OFFSET 1024
#define WAVE_FORMAT_PCM_ 0x0001
#define WAVE_FORMAT_IEEE_FLOAT_ 0x0003
@ -175,6 +175,9 @@ static int find_data_chunk(GString *buf, int initial_offset)
offset += 8 + RL32(buf->str + offset + 4);
}
if (offset > MAX_DATA_CHUNK_OFFSET)
return -1;
return offset;
}