Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and…
Browse files Browse the repository at this point in the history
… texture access is SDL_TEXTUREACCESS_STATIC
  • Loading branch information
zenios committed Jun 10, 2011
1 parent f38adce commit 2d004d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/render/software/SDL_render_sw.c
Expand Up @@ -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 +
Expand All @@ -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;
}

Expand Down

0 comments on commit 2d004d7

Please sign in to comment.