Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/det_vesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ void detectar_vesa(void) { // Detects available video modes
} else {
for(i=0;modes[i];++i) {
modos[i].ancho=modes[i]->w; modos[i].alto=modes[i]->h; modos[i].modo=1;
free(modes[i]);
}
num_modos=i-1;
free(modes);

}

Expand Down
12 changes: 5 additions & 7 deletions src/shared/osdep/osd_sdl12.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void OSDEP_SetCaption(char *title, char *icon) {
OSDEP_VMode **OSDEP_ListModes(void) {
SDL_Rect **modes;
int i;
static OSDEP_VMode *smodes[1024];
OSDEP_VMode **smodes;

modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
if(modes == (SDL_Rect **)0) {
Expand All @@ -71,15 +71,13 @@ OSDEP_VMode **OSDEP_ListModes(void) {
return -1;
}

for(i = 0; modes[i]; ++i) {
if(modes[i]) {
smodes = calloc(1024, sizeof(OSDEP_VMode *));

for(i = 0; i < 1023 && modes[i]; ++i) {
//Note: smodes[1023] reserved to NULL
smodes[i] = (OSDEP_VMode *)malloc(sizeof(OSDEP_VMode));
smodes[i]->w = modes[i]->w;
smodes[i]->h = modes[i]->h;
}
else {
smodes[i] = NULL;
}
}

return smodes;
Expand Down