From 7bc15a088313a3e15ecf03d3d9b5b2b710fe1a3e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 26 Feb 2021 04:51:38 +0000 Subject: [PATCH] Add detection of UDIF's LZMA chunks. --- Aaru.Images/UDIF/Constants.cs | 1 + Aaru.Images/UDIF/Read.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Aaru.Images/UDIF/Constants.cs b/Aaru.Images/UDIF/Constants.cs index 147c52155..4f7b6b9b4 100644 --- a/Aaru.Images/UDIF/Constants.cs +++ b/Aaru.Images/UDIF/Constants.cs @@ -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; diff --git a/Aaru.Images/UDIF/Read.cs b/Aaru.Images/UDIF/Read.cs index 8f8edde2f..952868ff5 100644 --- a/Aaru.Images/UDIF/Read.cs +++ b/Aaru.Images/UDIF/Read.cs @@ -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)