summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/chd.c
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2012-09-08 11:59:58 +0000
committer smf- <smf-@users.noreply.github.com>2012-09-08 11:59:58 +0000
commit44cd4a476a03b9eb5dc10e6a1b2e64e6566e811d (patch)
tree1f3e4c158145c9062dd7b3d06c97d31db6667285 /src/lib/util/chd.c
parent679e9323bee9b32c69836da62c336b274146136f (diff)
(MESS) support for writing to compressed hard drives using diff files. [smf]
Diffstat (limited to 'src/lib/util/chd.c')
-rw-r--r--src/lib/util/chd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index 406b478eb14..53a330727a6 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -1589,6 +1589,9 @@ void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1)
m_compression[2] = be_read(&rawheader[24], 4);
m_compression[3] = be_read(&rawheader[28], 4);
+ if (compressed() && m_allow_writes)
+ throw CHDERR_FILE_NOT_WRITEABLE;
+
// describe the format
m_mapoffset_offset = 40;
m_metaoffset_offset = 48;