diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index d8d77f98318b12f1cbc366f430f479c098ef2b14..dabd7bed92bd56989ce543b6890d21eb369938cd 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -488,8 +488,11 @@ static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags) if ((sizes[i]->w >= *w) && (sizes[i]->h >= *h)) { /* Mode with any dimension smaller or equal than current best ? */ if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) { - best=i; - supported = 1; + /* Now choose the mode that has less pixels */ + if ((sizes[i]->w * sizes[i]->h) < (sizes[best]->w * sizes[best]->h)) { + best=i; + supported = 1; + } } } }