SDL_dgavideo.c

Hello,

a customer (ldb at ldb.ods.org <mailto:ldb at ldb.ods.org>) has found the
following in src/video/dga/SDL_dgavideo.c:

The problem is probably the use of modes[i] after modes has been freed.
The code should either use mode-> or delay freeing modes.
I have not tested whether fixing this solves the problem.

/* Set the video mode */
mode = SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, modes[i].num);
XFree(modes);
if ( mode == NULL ) {
SDL_SetError(“Unable to switch to requested mode”);
return(NULL);
}
DGA_visualClass = modes[i].visualClass;
memory_base = (Uint8 *)mode->data;
memory_pitch = mode->mode.bytesPerScanline;

— src/video/dga/SDL_dgavideo.c.~1.12.~ 2002-11-09 07:20:46.000000000 +0100
+++ src/video/dga/SDL_dgavideo.c 2002-12-03 12:50:18.000000000 +0100
@@ -474,6 +474,6 @@
SDL_SetError(“Unable to switch to requested mode”);
return(NULL);
}

  • DGA_visualClass = modes[i].visualClass;
  • DGA_visualClass = mode->mode.visualClass;
    memory_base = (Uint8 *)mode->data;
    memory_pitch = mode->mode.bytesPerScanline;

Will this fix be included into CVS and the next release?

Regards
Thomas Woerner

Will this fix be included into CVS and the next release?

Yep, it’s in CVS now.

Thank you very much! :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment