Fix decoding disc information smaller than 34 bytes. Fixes #675

This commit is contained in:
2021-09-30 02:04:42 +01:00
parent 0c1bc24646
commit ae375b36f5

View File

@@ -55,7 +55,7 @@ namespace Aaru.Decoders.SCSI.MMC
{
public static StandardDiscInformation? Decode000b(byte[] response)
{
if(response.Length < 34)
if(response.Length < 32)
return null;
if((response[2] & 0xE0) != 0)
@@ -100,6 +100,9 @@ namespace Aaru.Decoders.SCSI.MMC
Array.Reverse(temp);
decoded.DiscBarcode = BitConverter.ToUInt64(temp, 0);
if(response.Length < 34)
return null;
decoded.DiscApplicationCode = response[32];
decoded.OPCTablesNumber = response[33];