diff options
author | Jonathan Liu <net147@gmail.com> | 2022-02-03 23:30:56 +1100 |
---|---|---|
committer | Jonathan Liu <net147@gmail.com> | 2022-06-04 11:22:56 +1100 |
commit | 0083cde53e38531ae77b74435218d94344a50323 (patch) | |
tree | ef24b2965c1a8c45f233791fcb8ae72542370215 /src/gui/util | |
parent | 8aacf83a76aa8d4896bbfb1b3a6e81fa697ae4e6 (diff) |
QEdidParser: fix number of data blocks
The EDID standard defines 4 x 18 byte descriptors:
54-71: Descriptor 1
72-89: Descriptor 2
90-107: Descriptor 3
108-125: Descriptor 4
Immediately following the 4th 18 byte descriptor are the following:
126: Number of extensions
127: Checksum
Therefore the number of data blocks (known as descriptors in the EDID
standard) should be 4 instead of 5.
Pick-to: 5.15 6.2 6.3
Change-Id: I63555b9142125df17b26401d81a6717936832162
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qedidparser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/util/qedidparser.cpp b/src/gui/util/qedidparser.cpp index b989503ec2..191eea710b 100644 --- a/src/gui/util/qedidparser.cpp +++ b/src/gui/util/qedidparser.cpp @@ -12,6 +12,7 @@ #define EDID_DESCRIPTOR_PRODUCT_NAME 0xfc #define EDID_DESCRIPTOR_SERIAL_NUMBER 0xff +#define EDID_DATA_BLOCK_COUNT 4 #define EDID_OFFSET_DATA_BLOCKS 0x36 #define EDID_OFFSET_LAST_BLOCK 0x6c #define EDID_OFFSET_PNP_ID 0x08 @@ -104,7 +105,7 @@ bool QEdidParser::parse(const QByteArray &blob) serialNumber = QString(); // Parse EDID data - for (int i = 0; i < 5; ++i) { + for (int i = 0; i < EDID_DATA_BLOCK_COUNT; ++i) { const uint offset = EDID_OFFSET_DATA_BLOCKS + i * 18; if (data[offset] != 0 || data[offset + 1] != 0 || data[offset + 2] != 0) |