# HG changeset patch # User Sam Lantinga # Date 1253960269 0 # Node ID 9cf18687b761979dadd13b4e53d99328d0967cd0 # Parent 87ffdad11607371a88e488fe6127d44a7336398e Fixed bug #764 Added better error checking from Mason Wheeler diff -r 87ffdad11607 -r 9cf18687b761 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) {