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:
parent
3931adeca5
commit
ff4785e65e
1 changed files with 3 additions and 3 deletions
|
@ -122,19 +122,19 @@ int wfd_get_resolutions(enum wfd_resolution_standard std,
|
||||||
{
|
{
|
||||||
switch(std) {
|
switch(std) {
|
||||||
case WFD_RESOLUTION_STANDARD_CEA:
|
case WFD_RESOLUTION_STANDARD_CEA:
|
||||||
if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_cea)) {
|
if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_cea)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*out = resolutions_cea[index];
|
*out = resolutions_cea[index];
|
||||||
return 0;
|
return 0;
|
||||||
case WFD_RESOLUTION_STANDARD_VESA:
|
case WFD_RESOLUTION_STANDARD_VESA:
|
||||||
if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_vesa)) {
|
if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_vesa)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*out = resolutions_vesa[index];
|
*out = resolutions_vesa[index];
|
||||||
return 0;
|
return 0;
|
||||||
case WFD_RESOLUTION_STANDARD_HH:
|
case WFD_RESOLUTION_STANDARD_HH:
|
||||||
if(0 >= index || index < SHL_ARRAY_LENGTH(resolutions_hh)) {
|
if(0 >= index || index >= SHL_ARRAY_LENGTH(resolutions_hh)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*out = resolutions_hh[index];
|
*out = resolutions_hh[index];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue