From ff4785e65ef78cc4d8fd285f80e58c2bd3d10418 Mon Sep 17 00:00:00 2001 From: Derek Dai Date: Wed, 5 Apr 2017 16:43:31 +0800 Subject: [PATCH] fix loop boundary checking --- src/ctl/wfd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ctl/wfd.c b/src/ctl/wfd.c index 46b9a4c..651c52e 100644 --- a/src/ctl/wfd.c +++ b/src/ctl/wfd.c @@ -122,19 +122,19 @@ int wfd_get_resolutions(enum wfd_resolution_standard std, { switch(std) { case WFD_RESOLUTION_STANDARD_CEA: - if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_cea)) { + if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_cea)) { break; } *out = resolutions_cea[index]; return 0; case WFD_RESOLUTION_STANDARD_VESA: - if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_vesa)) { + if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_vesa)) { break; } *out = resolutions_vesa[index]; return 0; case WFD_RESOLUTION_STANDARD_HH: - if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_hh)) { + if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_hh)) { break; } *out = resolutions_hh[index];