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 4108

Summary: Missing break statements in SDL_CDResume and SDL_CDStop
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: cdromAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: All   
OS: All   

Description Ozkan Sezer 2018-03-13 07:52:09 UTC
Two break statements are missing in SDL_cdrom.c:SDL_CDResume()
and SDL_CDStop(), which negate the returned code from driver
and always return 0.  The following patch adds those breaks.

diff --git a/src/cdrom/SDL_cdrom.c b/src/cdrom/SDL_cdrom.c
--- a/src/cdrom/SDL_cdrom.c
+++ b/src/cdrom/SDL_cdrom.c
@@ -285,6 +285,7 @@ int SDL_CDResume(SDL_CD *cdrom)
 	switch (status) {
 		case CD_PAUSED:
 			retval = SDL_CDcaps.Resume(cdrom);
+			break;
 		default:
 			retval = 0;
 			break;
@@ -307,6 +308,7 @@ int SDL_CDStop(SDL_CD *cdrom)
 		case CD_PLAYING:
 		case CD_PAUSED:
 			retval = SDL_CDcaps.Stop(cdrom);
+			break;
 		default:
 			retval = 0;
 			break;
Comment 1 Sam Lantinga 2018-03-24 17:16:00 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/2b3d476e2ed9