video_common: Fixed search algo for resolution less than supported

check for boundary case when mid=0 before decrementing

Signed-off-by: Rohit Consul <rohit.consul@xilinx.com>
This commit is contained in:
Rohit Consul 2015-05-27 16:12:42 -07:00 committed by Nava kishore Manne
parent cfe280bd79
commit 96929a7703

View file

@ -217,7 +217,12 @@ XVidC_VideoMode XVidC_GetVideoModeId(u32 Width, u32 Height, u32 FrameRate,
break;
}
else if (Width < HActive) {
High = Mid - 1;
if (Mid == 0) {
break;
}
else {
High = Mid - 1;
}
}
else {
Low = Mid + 1;