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 - Missing break statements in SDL_CDResume and SDL_CDStop
Summary: Missing break statements in SDL_CDResume and SDL_CDStop
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: cdrom (show other bugs)
Version: HG 1.2
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-13 07:52 UTC by Ozkan Sezer
Modified: 2018-03-24 17:16 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 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