From 33cc2c8bc3f81615b348e5d3b0945887b365168a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Fauberteau?= Date: Fri, 2 Jan 2026 13:11:02 +0100 Subject: [PATCH] Fix abort with ctype(3) on NetBSD 11 In NetBSD 11, the ctype functions will crash with a signal on certain invalid inputs as a diagnostic aid for applications. NetBSD defines tolower(3) with CTYPE_CHECK() that verifies that (c < 0 || c > UCHAR_MAX). In the case of mp4v2::impl::MP4NameFirstMatches, it aborts when s1 is "\251nam". --- src/mp4util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mp4util.cpp b/src/mp4util.cpp index 8a915b2..4212f3e 100644 --- a/src/mp4util.cpp +++ b/src/mp4util.cpp @@ -40,7 +40,7 @@ bool MP4NameFirstMatches(const char* s1, const char* s2) if (*s2 == '\0' || strchr("[.", *s2)) { break; } - if (tolower(*s1) != tolower(*s2)) { + if (tolower((unsigned char)*s1) != tolower((unsigned char)*s2)) { return false; } s1++;