Media (Linux): handles invalid percent-encoding in cover metadata

This commit is contained in:
李通洲
2025-11-11 15:16:12 +08:00
parent 084f9294f2
commit 9f24e4363f
+9 -3
View File
@@ -86,9 +86,15 @@ static bool parseMprisMetadata(FFDBusData* data, DBusMessageIter* rootIterator,
if (i + 2 >= path.length)
break;
char str[] = { path.chars[i + 1], path.chars[i + 2], 0 };
const char decodedChar = (char) strtoul(str, NULL, 16);
i += 2;
ffStrbufAppendC(&result->cover, decodedChar);
char* end = NULL;
const char decodedChar = (char) strtoul(str, &end, 16);
if (end == &str[2])
{
i += 2;
ffStrbufAppendC(&result->cover, decodedChar);
}
else
ffStrbufAppendC(&result->cover, '%');
}
else
{