From 94b138a3c3d07cf5581c07536c53a97cebf885d9 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Mon, 27 Apr 2015 00:13:23 +0200 Subject: [PATCH] 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. --- src/input/wav.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/input/wav.c b/src/input/wav.c index 271bacef..4f36e8c4 100644 --- a/src/input/wav.c +++ b/src/input/wav.c @@ -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;