Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c66291ec authored by Frederik Gladhorn's avatar Frederik Gladhorn

EDID parsing: strings are up to 13 bytes

Summary:
The descriptor blocks with strings come every 18 bytes,
5 are the header, e.g. for the model:
[0x00 0x00 0x00 0xFC 0x00] followed by the data (13 bytes).

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14410
parent ade751b3
......@@ -406,9 +406,9 @@ double Edid::Private::edidDecodeFraction(int high, int low) const
QString Edid::Private::edidParseString(const quint8 *data) const
{
/* this is always 12 bytes, but we can't guarantee it's null
/* this is always 13 bytes, but we can't guarantee it's null
* terminated or not junk. */
auto text = QString::fromLocal8Bit(reinterpret_cast<const char*>(data), 12);
auto text = QString::fromLocal8Bit(reinterpret_cast<const char*>(data), 13);
// Remove newlines, extra spaces and stuff
return text.simplified();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment