We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 764 - SDL_Video patch for better error reporting
Summary: SDL_Video patch for better error reporting
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Windows Vista
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-06 11:14 UTC by Mason Wheeler
Modified: 2009-09-26 03:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mason Wheeler 2009-07-06 11:14:06 UTC
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) {
Comment 1 Sam Lantinga 2009-09-26 03:18:04 UTC
This fix is in subversion, thanks!