X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fedid.c;h=90d1167f6eee9d2191dc4f8e3f4361ecaa235716;hb=407b5b956a2e0facf6668fc8b295f4be9205c83e;hp=19410aa4fcc52c3ff993dfe8d64a5b470d419c1b;hpb=d09ec7f81650425140776995fc9752189ddf7956;p=oweals%2Fu-boot.git diff --git a/common/edid.c b/common/edid.c index 19410aa4fc..90d1167f6e 100644 --- a/common/edid.c +++ b/common/edid.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2012 The Chromium OS Authors. * * (C) Copyright 2010 * Petr Stetiar * - * SPDX-License-Identifier: GPL-2.0+ - * * Contains stolen code from ddcprobe project which is: * Copyright (C) Nalin Dahyabhai */ @@ -148,8 +147,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 +294,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 */