Commit b43aca32 authored by Dimitris Zenios's avatar Dimitris Zenios

Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture...

Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC
parent 2fdcb7bd
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment