Set ATIP to be a class to ensure it is nulled properly.. Fixes #352

This commit is contained in:
2020-11-01 20:10:20 +00:00
parent b2458f3db9
commit 080ad0ed51
9 changed files with 23 additions and 21 deletions

View File

@@ -67,12 +67,12 @@ namespace Aaru.Core.Devices.Dumping
if(!sense)
{
ATIP.CDATIP? atip = ATIP.Decode(cmdBuf);
ATIP.CDATIP atip = ATIP.Decode(cmdBuf);
if(atip.HasValue)
if(atip != null)
{
// Only CD-R and CD-RW have ATIP
mediaType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
mediaType = atip.DiscType ? MediaType.CDRW : MediaType.CDR;
tmpBuf = new byte[cmdBuf.Length - 4];
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);