Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC
authorDimitris Zenios <dimitris.zenios@gmail.com>
Fri, 10 Jun 2011 12:13:06 +0300
changeset 5567 441c3036440c
parent 5566 0d221d6ffac8
child 5570 70b6f92e4539
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
--- a/src/render/software/SDL_render_sw.c	Sat Jul 16 14:59:12 2011 -0700
+++ b/src/render/software/SDL_render_sw.c	Fri Jun 10 12:13:06 2011 +0300
@@ -240,6 +240,8 @@
     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 @@
         src += pitch;
         dst += surface->pitch;
     }
+    if(SDL_MUSTLOCK(surface))
+        SDL_UnlockSurface(surface);
     return 0;
 }