1
0
Fork 0

avoid (rare) possibility of a crash when corrupted cdrom images are loaded

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3226
This commit is contained in:
Sebastian Strohhäcker 2008-09-29 17:50:18 +00:00
parent 30d2c50b9f
commit e3c5fe0708

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cdrom_image.cpp,v 1.21 2008-09-07 10:55:14 c2woody Exp $ */
/* $Id: cdrom_image.cpp,v 1.22 2008-09-29 17:50:18 c2woody Exp $ */
#include <cctype>
#include <cmath>
@ -200,8 +200,9 @@ bool CDROM_Interface_Image::GetAudioTrackInfo(int track, TMSF& start, unsigned c
bool CDROM_Interface_Image::GetAudioSub(unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos)
{
track = GetTrack(player.currFrame);
if (track < 1) return false;
int cur_track = GetTrack(player.currFrame);
if (cur_track < 1) return false;
track = (unsigned char)cur_track;
attr = tracks[track - 1].attr;
index = 1;
FRAMES_TO_MSF(player.currFrame + 150, &absPos.min, &absPos.sec, &absPos.fr);