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

Commit

Permalink
Fixed bug #764
Browse files Browse the repository at this point in the history
Added better error checking from Mason Wheeler
  • Loading branch information
slouken committed Sep 26, 2009
1 parent aa27963 commit 23900a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/video/SDL_video.c
Expand Up @@ -2417,11 +2417,17 @@ SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect * srcrect,
SDL_Rect real_srcrect;
SDL_Rect real_dstrect;

if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
return -1;
}
renderer = SDL_CurrentDisplay.current_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;
}
if (!renderer->RenderCopy) {
Expand Down

0 comments on commit 23900a0

Please sign in to comment.