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 165

Summary: QZ_DisplayYUV has wrong return value code
Product: SDL Reporter: Rob Arnold <rob>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X (All)   

Description Rob Arnold 2006-03-14 21:06:07 UTC
SDL_DisplayYUVOverlay() is defined to return 0 on success.
The Quartz function QZ_DisplayYUV (which SDL_DisplayYUVOverlay() maps to for me) on the other hand calls the external apple func DecompressSequenceFramesS() which also returns 0, aka noErr, on success.  It's return value is assigned to err.

Then, for no reason I can fathon, QZ_DisplayYUV() returns with this line:
return err == noErr;

So, if everything went right, err will be 0, which is also what noErr is defined to be, so if everything goes successfully, you'll return 1, not 0.  I believe the last return statement should simply be:  return err;

I'm not clear on how this has not been caught already, so I'm wondering if I've missed something, but it looks like this is in CVS head, and has been in every past version I've bothered to look at.
Comment 1 Ryan C. Gordon 2006-03-15 00:52:44 UTC
Fixed in CVS, thanks!

--ryan.