Call TOC_Init at first

This commit is contained in:
twinaphex 2016-08-14 04:47:47 +02:00
parent 9ffdfb19ef
commit f31ab4600c
2 changed files with 2 additions and 2 deletions

View File

@ -108,8 +108,6 @@ void CDAccess_CCD::Load(const char *path, bool image_memcache)
char img_extsd[4] = { 'i', 'm', 'g', 0 };
char sub_extsd[4] = { 's', 'u', 'b', 0 };
TOC_Init(&tocd);
MDFN_GetFilePathComponents(path, &dir_path, &file_base, &file_ext);
if(file_ext.length() == 4 && file_ext[0] == '.')

View File

@ -203,6 +203,8 @@ CDIF_ST::CDIF_ST(CDAccess *cda) : disc_cdaccess(cda)
UnrecoverableError = false;
DiscEjected = false;
TOC_Init(&disc_toc);
disc_cdaccess->Read_TOC(&disc_toc);
if(disc_toc.first_track < 1 || disc_toc.last_track > 99 || disc_toc.first_track > disc_toc.last_track)