diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-08-18 00:29:07 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-08-18 00:29:07 +0200 |
commit | 2db8a86742d695393cfd70bbb8b3af21d2243bfc (patch) | |
tree | 8c74ca0c613282f4d64f11b549c25f682ce5a15f | |
parent | f2c85a2f36f57f155cda7bc9f7c42b44f1a2439e (diff) | |
download | qemu-2db8a86742d695393cfd70bbb8b3af21d2243bfc.tar.gz |
block/dmg: document UDIF trailer offset
It was not immediately obvious why 0x1d8 was subtracted.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | block/dmg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/block/dmg.c b/block/dmg.c index e455886d2b..46a8a5a8b1 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -151,9 +151,11 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags, ret = offset; goto fail; } - offset -= 0x1d8; + /* go the beginning of the UDIF trailer */ + offset -= 0x200; - ret = read_uint64(bs, offset, &info_begin); + /* offset of resource fork (RsrcForkOffset) */ + ret = read_uint64(bs, offset + 0x28, &info_begin); if (ret < 0) { goto fail; } else if (info_begin == 0) { |