Return an error for an invalid .bin image.

I have been able to trigger the assert, so I think it needs to become an error.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2023-06-07 20:17:53 +01:00
parent 03ce472e63
commit ff3adbda0d

View File

@ -78,7 +78,8 @@ ImageError_e ImageOpen( const std::string & pszImageFilename,
if (!bExpectFloppy)
return eIMAGE_ERROR_UNSUPPORTED;
_ASSERT(pImageInfo->uNumTracks);
if (!pImageInfo->uNumTracks)
return eIMAGE_ERROR_UNSUPPORTED;
*pWriteProtected = pImageInfo->bWriteProtected;