From b43aca329d9bc1c17807fa1a2ab29e8cbb64f439 Mon Sep 17 00:00:00 2001 From: Dimitris Zenios Date: Fri, 10 Jun 2011 12:13:06 +0300 Subject: [PATCH] Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC --- src/render/software/SDL_render_sw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 774eaceda..30c22727b 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -240,6 +240,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, int row; size_t length; + if(SDL_MUSTLOCK(surface)) + SDL_LockSurface(surface); src = (Uint8 *) pixels; dst = (Uint8 *) surface->pixels + rect->y * surface->pitch + @@ -250,6 +252,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, src += pitch; dst += surface->pitch; } + if(SDL_MUSTLOCK(surface)) + SDL_UnlockSurface(surface); return 0; }