wav: Stricter check for valid chunk ID.

isascii() is a superset of isalpha() and isblank() so the current
code doesn't really make sense.
Moreover, isascii(x) is just a funky and non standard way to
write x < 128.
This commit is contained in:
Aurelien Jacobs 2015-04-27 00:13:23 +02:00 committed by Uwe Hermann
parent 2b51d48b38
commit 94b138a3c3
1 changed files with 1 additions and 2 deletions

View File

@ -165,8 +165,7 @@ static int find_data_chunk(GString *buf, int initial_offset)
/* Skip into the samples. */
return offset + 8;
for (i = 0; i < 4; i++) {
if (!isalpha(buf->str[offset + i])
&& !isascii(buf->str[offset + i])
if (!isalnum(buf->str[offset + i])
&& !isblank(buf->str[offset + i]))
/* Doesn't look like a chunk ID. */
return -1;