Fixed bug #764
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Sep 2009 10:17:49 +0000
changeset 33169cf18687b761
parent 3315 87ffdad11607
child 3317 b29eb7ce5352
Fixed bug #764

Added better error checking from Mason Wheeler
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sat Sep 26 10:13:44 2009 +0000
     1.2 +++ b/src/video/SDL_video.c	Sat Sep 26 10:17:49 2009 +0000
     1.3 @@ -2417,11 +2417,17 @@
     1.4      SDL_Rect real_srcrect;
     1.5      SDL_Rect real_dstrect;
     1.6  
     1.7 -    if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
     1.8 +    renderer = SDL_CurrentDisplay.current_renderer;
     1.9 +    if (!renderer) {
    1.10 +        SDL_SetError("No current renderer available");
    1.11          return -1;
    1.12      }
    1.13 -    renderer = SDL_CurrentDisplay.current_renderer;
    1.14 -    if (!renderer) {
    1.15 +    if (!texture) {
    1.16 +        SDL_SetError("Texture not found");
    1.17 +        return -1;
    1.18 +    }
    1.19 +    if (texture->renderer != renderer) {
    1.20 +        SDL_SetError("Texture was not created with this renderer");
    1.21          return -1;
    1.22      }
    1.23      if (!renderer->RenderCopy) {