Fixed bug #764
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Sep 2009 10:17:49 +0000
changeset 3316 9cf18687b761
parent 3315 87ffdad11607
child 3317 b29eb7ce5352
Fixed bug #764 Added better error checking from Mason Wheeler
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Sat Sep 26 10:13:44 2009 +0000
+++ b/src/video/SDL_video.c	Sat Sep 26 10:17:49 2009 +0000
@@ -2417,11 +2417,17 @@
     SDL_Rect real_srcrect;
     SDL_Rect real_dstrect;
 
-    if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
+    renderer = SDL_CurrentDisplay.current_renderer;
+    if (!renderer) {
+        SDL_SetError("No current renderer available");
         return -1;
     }
-    renderer = SDL_CurrentDisplay.current_renderer;
-    if (!renderer) {
+    if (!texture) {
+        SDL_SetError("Texture not found");
+        return -1;
+    }
+    if (texture->renderer != renderer) {
+        SDL_SetError("Texture was not created with this renderer");
         return -1;
     }
     if (!renderer->RenderCopy) {