Add detection of UDIF's LZMA chunks.

This commit is contained in:
2021-02-26 04:51:38 +00:00
parent a4408cb0be
commit 7bc15a0883
2 changed files with 5 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ namespace Aaru.DiscImages
const uint CHUNK_TYPE_ZLIB = 0x80000005;
const uint CHUNK_TYPE_BZIP = 0x80000006;
const uint CHUNK_TYPE_LZFSE = 0x80000007;
const uint CHUNK_TYPE_LZMA = 0x80000008;
const uint CHUNK_TYPE_COMMNT = 0x7FFFFFFE;
const uint CHUNK_TYPE_END = 0xFFFFFFFF;

View File

@@ -350,10 +350,13 @@ namespace Aaru.DiscImages
case CHUNK_TYPE_LZFSE:
throw new
ImageNotSupportedException("Chunks compressed with lzfse are not yet supported.");
case CHUNK_TYPE_LZMA:
throw new
ImageNotSupportedException("Chunks compressed with lzma are not yet supported.");
}
if((bChnk.type > CHUNK_TYPE_NOCOPY && bChnk.type < CHUNK_TYPE_COMMNT) ||
(bChnk.type > CHUNK_TYPE_LZFSE && bChnk.type < CHUNK_TYPE_END))
(bChnk.type > CHUNK_TYPE_LZMA && bChnk.type < CHUNK_TYPE_END))
throw new ImageNotSupportedException($"Unsupported chunk type 0x{bChnk.type:X8} found");
if(bChnk.sectors > 0)