The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL12: bug in SDL_dx5video.c
emu1233


Joined: 11 Nov 2016
Posts: 3
Noted a bug with a possible patch below based on the fact that the error refers to "SDL surface memory", so the intent of the line must have been to check for a swsurface. The alternative is that the line was meant to disable that block of code, but I would think if(0) would have been used. Thank you for any help.

Code:
--- SDL-1.2-ORIG//src/video/windx5/SDL_dx5video.c
+++ SDL-1.2//src/video/windx5/SDL_dx5video.c
@@ -1784,7 +1784,7 @@ static int DX5_AllocDDSurface(_THIS, SDL
    }
    IDirectDrawSurface3_Unlock(dd_surface3, NULL);
 
-   if ( (flag & SDL_HWSURFACE) == SDL_SWSURFACE ) {
+   if ( (flag & SDL_SWSURFACE) == SDL_SWSURFACE ) {
       if ( ddsd.lpSurface != surface->pixels ) {
          SDL_SetError("DDraw didn't use SDL surface memory");
          goto error_end;
Re: SDL12: bug in SDL_dx5video.c
emu1233


Joined: 11 Nov 2016
Posts: 3
On further study of the code, I think now that I was wrong and that there is no bug. The check must be for either swsurface or hwsurface, and the current code does this check (and other checks in dx5video) as expected.