[Libdlo] libdlo: Bug in dlo_mode_parse_edid()

Nuno Lucas ntlucas at gmail.com
Fri May 4 11:48:02 PDT 2012


Hello,

While checking a warning, found what I believe it's a bug in the library code.

I'm pasting my fix here as it's trivial enough.

--- libdlo/dlo_mode.c
+++ libdlo/dlo_mode.c
@@ -467,8 +467,8 @@ dlo_retcode_t dlo_mode_parse_edid(dlo_de
   edid->ext_blocks = RD_B(ptr + 0x7E);

   /* Parse all of the standard timing identification */
-  for (i = 0; i < sizeof(edid->std_timings.timing_id); i++)
-    edid->std_timings.timing_id[i] = RD_B(ptr + 0x26 + i);
+  for (i = 0; i < sizeof(edid->std_timings.timing_id)/2; i++)
+    edid->std_timings.timing_id[i] = RD_S(ptr + 0x26 + i*2);

   /* Parse all of the detailed timing descriptions (monitor
descriptors not supported) */
   for (i = 0; i < 4; i++) {


Note: I didn't see any real problem with this bug with my use-case of
the library. Just found this by accident.

Best regards,
~Nuno Lucas


More information about the Libdlo mailing list