Commit ac573d85 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #764

Added better error checking from Mason Wheeler

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403908
parent ba8fff9a
...@@ -2417,11 +2417,17 @@ SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect * srcrect, ...@@ -2417,11 +2417,17 @@ SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect * srcrect,
SDL_Rect real_srcrect; SDL_Rect real_srcrect;
SDL_Rect real_dstrect; SDL_Rect real_dstrect;
if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
return -1;
}
renderer = SDL_CurrentDisplay.current_renderer; renderer = SDL_CurrentDisplay.current_renderer;
if (!renderer) { if (!renderer) {
SDL_SetError("No current renderer available");
return -1;
}
if (!texture) {
SDL_SetError("Texture not found");
return -1;
}
if (texture->renderer != renderer) {
SDL_SetError("Texture was not created with this renderer");
return -1; return -1;
} }
if (!renderer->RenderCopy) { if (!renderer->RenderCopy) {
......
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