main: limit EDID length to 256 bytes

This commit is contained in:
King Kévin 2022-08-05 12:45:52 +02:00
parent 2f0ffb9c5a
commit 31815bd66e
1 changed files with 4 additions and 1 deletions

5
main.c
View File

@ -378,7 +378,10 @@ i2c_end:
softi2c_master_stop();
if (0 == i2c_rc) {
puts("success\r\n");
const uint16_t edid_len = edid_length(edid_sink); // get length
uint16_t edid_len = edid_length(edid_sink); // get length
if (edid_len > 256) { // we only support up to one extension
edid_len = 256;
}
if (edid_len) { // EDID is valid
edid_modify(edid_sink); // modify EDID to include firewall indication
// compare saved/source and sink EDID