Playing a non-existent CD should fail instead of crash.

This commit is contained in:
Ove Kaaven 1999-01-03 12:27:28 +00:00 committed by Alexandre Julliard
parent ca004e5037
commit d4fb05707a
1 changed files with 6 additions and 0 deletions

View File

@ -757,6 +757,12 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa
} else if (wcda == NULL) {
ret = MCIERR_INVALID_DEVICE_ID;
} else {
if (wcda->nTracks == 0) {
if (!CDAUDIO_GetTracksInfo(wcda)) {
WARN(cdaudio, "error reading TracksInfo !\n");
return MCIERR_DRIVER_INTERNAL;
}
}
end = wcda->dwTotalLen;
wcda->nCurTrack = 1;
if (dwFlags & MCI_FROM) {