summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-12-25 22:47:27 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-12-25 22:47:27 +0100
commit9095ab66a62a820d3a7df6d648e985a4956f6a4f (patch)
treed357b08c99f92b9b2e25033088deaa29b37ca2c0
parent7bb37b813ef9f06e7aa6d7b3c0e4ba2b9ec3f1c1 (diff)
downloadqemu-9095ab66a62a820d3a7df6d648e985a4956f6a4f.tar.gz
[SQUASH ME] block/dmg: be less restrictive on sec cnt checkblock-dmg-working-except-for-manual-offset-hack
not needed since memset is used instead of buffer.
-rw-r--r--block/dmg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/dmg.c b/block/dmg.c
index 87f4b9e0da..3160d3a344 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -227,7 +227,9 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds,
s->sectorcounts[i] = buff_read_uint64(buffer, offset);
offset += 8;
- if (s->sectorcounts[i] > DMG_SECTORCOUNTS_MAX) {
+ /* all-zeroes sector (type 2) does not need to be "uncompressed" and can
+ * therefore be unbounded. */
+ if (s->types[i] != 2 && s->sectorcounts[i] > DMG_SECTORCOUNTS_MAX) {
error_report("sector count %" PRIu64 " for chunk %" PRIu32
" is larger than max (%u)",
s->sectorcounts[i], i, DMG_SECTORCOUNTS_MAX);