From: Simon Glass Date: Wed, 7 Jun 2017 16:28:39 +0000 (-0600) Subject: edid: Use sizeof() in cea_is_hdmi_vsdb_present() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=66a1b30d14566676293ba4010a0d592adc61ce95;p=u-boot.git edid: Use sizeof() in cea_is_hdmi_vsdb_present() We should not use an open-coded value here. Use sizeof() instead. Signed-off-by: Simon Glass Reported-by: Coverity (CID: 163252) Fixes: 43c6bdd0 (edid: Add HDMI flag to timing info) --- diff --git a/common/edid.c b/common/edid.c index 854d40c8f8..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;