X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fedid.c;h=3d0809ad11c2d2e1ca615a9cac681233cb1e6dd5;hb=6158d0b42411165d34635a2ddfea17e12dce3329;hp=19410aa4fcc52c3ff993dfe8d64a5b470d419c1b;hpb=43c6bdd0209ca31be84d572278485ed604582730;p=u-boot diff --git a/common/edid.c b/common/edid.c index 19410aa4fc..3d0809ad11 100644 --- a/common/edid.c +++ b/common/edid.c @@ -148,8 +148,8 @@ static bool cea_is_hdmi_vsdb_present(struct edid_cea861_info *info) /* check for end of data block */ end = info->dtd_offset; if (end == 0) - end = 127; - if (end < 4 || end > 127) + end = sizeof(info->data); + if (end < 4 || end > sizeof(info->data)) return false; end -= 4; @@ -295,7 +295,7 @@ static void edid_print_dtd(struct edid_monitor_descriptor *monitor, h_total = h_active + h_blanking; v_total = v_active + v_blanking; - if (v_total * h_total) + if (v_total > 0 && h_total > 0) vfreq = pixclock / (v_total * h_total); else vfreq = 1; /* Error case */