Is there an RLE bug with SDL_SetSurfaceRLE?

I think there’s an RLE bug in SDL with SDL_SetSurfaceRLE.

Functions like SDL_LockSurface, and SDL_MUSTLOCK use surface->flags. However SDL_SetSurfaceRLE doesn’t update surface->flags , only the internal surface->map->info.flags .

SDL_SetSurfaceRLE(surf, SDL_TRUE);
assert (SDL_MUSTLOCK(surf)); // fails here, because SDL_MUSTLOCK(surf) should be true, but isn't.

Should SDL_SetSurfaceRLE (and therefore its callers SDL_SetColorKey+SDL_ConvertSurface) call SDL_RLESurface(surface)? This would set up the surface->flags correctly.

I added a bug report here:

1 Like