diff --git a/main.c b/main.c index 83416b5..1b99168 100644 --- a/main.c +++ b/main.c @@ -164,6 +164,12 @@ static void edid_modify(uint8_t* edid) { // modify EDID to include the character indicating the firewall const char firewall_indicator = '|'; // pipe/wall character to indicate the firewall + + // ensure we only have up to one extension + if (edid[126] > 1) { + edid[126] = 1; + } + // ensure descriptor 4 is for Display name if ((0 == edid[108]) && (0 == edid[109]) && (0 == edid[110]) && (0xfc == edid[111]) && (0 == edid[112])) { // ensure descriptor 4 is for Display name uint8_t last_c; // position of last character @@ -179,14 +185,15 @@ static void edid_modify(uint8_t* edid) while (last_c < 126) { edid[last_c++] = ' '; // insert padding space } - // calculate new checksum - uint8_t checksum = 0; - for (uint8_t i = 0; i < 127; i++) { - checksum += edid[i]; - } - edid[127] = (256 - checksum); } } + + // calculate new checksum + uint8_t checksum = 0; + for (uint8_t i = 0; i < 127; i++) { + checksum += edid[i]; + } + edid[127] = (256 - checksum); } void main(void)