| Summary: | SDL_Video patch for better error reporting | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Mason Wheeler <masonwheeler> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows Vista | ||
This fix is in subversion, thanks! |
This patch comes from the same codebase as the patch submitted in error #761, so some line numbers may be off if it hasn't been added yet. Index: SDL_video.c =================================================================== --- SDL_video.c (revision 4599) +++ SDL_video.c (working copy) @@ -2440,11 +2438,17 @@ SDL_Rect real_srcrect; SDL_Rect real_dstrect; - if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) { + if (!texture) { + SDL_SetError("Texture not found."); + return -1; + } + else if (texture->renderer != SDL_CurrentDisplay.current_renderer) { + SDL_SetError("Texture was not created with this renderer."); return -1; } renderer = SDL_CurrentDisplay.current_renderer; if (!renderer) { + SDL_SetError("No renderer found for this texture."); return -1; } if (!renderer->RenderCopy) {