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 5567441c3036440c
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
     1.1 --- a/src/render/software/SDL_render_sw.c	Sat Jul 16 14:59:12 2011 -0700
     1.2 +++ b/src/render/software/SDL_render_sw.c	Fri Jun 10 12:13:06 2011 +0300
     1.3 @@ -240,6 +240,8 @@
     1.4      int row;
     1.5      size_t length;
     1.6  
     1.7 +    if(SDL_MUSTLOCK(surface))
     1.8 +        SDL_LockSurface(surface);
     1.9      src = (Uint8 *) pixels;
    1.10      dst = (Uint8 *) surface->pixels +
    1.11                          rect->y * surface->pitch +
    1.12 @@ -250,6 +252,8 @@
    1.13          src += pitch;
    1.14          dst += surface->pitch;
    1.15      }
    1.16 +    if(SDL_MUSTLOCK(surface))
    1.17 +        SDL_UnlockSurface(surface);
    1.18      return 0;
    1.19  }
    1.20