I just spent several hours debugging an issue with SDL, and finally discovered a bug in SDL_gfx: the function rotateSurface90Degrees() has a copy&paste error in its implementation, which causes it to lock the returned surface twice:
if (SDL_MUSTLOCK(dst)) {
SDL_LockSurface(dst);
}
if (SDL_MUSTLOCK(dst)) {
SDL_LockSurface(dst);
}
(you can find this code here). Indeed, the author wanted to lock dst only once, and then to lock src. The end of the function has the respective calls to SDL_UnlockSurface().
I'm reporting this just to share the knowledge, in case someone bumps into this issue. I'm not sure if it's worth to write a patch for this. In any case, I've filed an upstream issue too: https://sourceforge.net/p/sdlgfx/bugs/16/ (assuming that the project is still alive)
I just spent several hours debugging an issue with SDL, and finally discovered a bug in SDL_gfx: the function
rotateSurface90Degrees()
has a copy&paste error in its implementation, which causes it to lock the returned surface twice:(you can find this code here). Indeed, the author wanted to lock
dst
only once, and then to locksrc
. The end of the function has the respective calls to SDL_UnlockSurface().I'm reporting this just to share the knowledge, in case someone bumps into this issue. I'm not sure if it's worth to write a patch for this. In any case, I've filed an upstream issue too: https://sourceforge.net/p/sdlgfx/bugs/16/ (assuming that the project is still alive)