mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Media (Linux): handles invalid percent-encoding in cover metadata
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user