1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

fix loop boundary checking

This commit is contained in:
Derek Dai 2017-04-05 16:43:31 +08:00
parent 3931adeca5
commit ff4785e65e
No known key found for this signature in database
GPG key ID: E109CC97553EF009

View file

@ -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];