msemediabuffer: Fix ASCII character detection

Use glib function. The previous check was checking whether a signed int was
lower than its limit (which ... is always TRUE).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8286>
This commit is contained in:
Edward Hervey 2025-01-05 11:46:21 +01:00 committed by GStreamer Marge Bot
parent efbe1e96ca
commit b78c119a42

View file

@ -56,12 +56,6 @@ is_token_character (const gchar c)
return g_ascii_isgraph (c);
}
static gboolean
is_ascii (const gchar c)
{
return c > 0 && c <= G_MAXINT8;
}
static gboolean
is_eos (const gchar c)
{
@ -135,8 +129,8 @@ quoted_string_char (const gchar ** input, gchar * value)
g_return_val_if_fail (value != NULL, FALSE);
const gchar *unparsed = *input;
char c = unparsed[0];
if (!is_ascii (c)) {
gchar c = unparsed[0];
if (!g_ascii_isprint (c)) {
return FALSE;
}
@ -160,7 +154,7 @@ escaped_ascii_char (const gchar ** input, gchar * value)
}
gchar c = (*input)[0];
if (!is_ascii (c)) {
if (!g_ascii_isprint (c)) {
return FALSE;
}