Hi Franco

a resulting bad map : bad_gmapsupp.img

Just one tile less - no problem - good_gmapsupp.img

Thanks for providing this useful test case.

This is a bug in the recent code used to calculate the best block size to use. It is missing a constraint on the block size to restrict the
number of blocks in the directory file.

The attached patch fixes this and I'll commit this today.


Index: src/uk/me/parabola/imgfmt/sys/ImgFS.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
--- src/uk/me/parabola/imgfmt/sys/ImgFS.java	(revision 4111)
+++ src/uk/me/parabola/imgfmt/sys/ImgFS.java	(date 1518530660000)
@@ -294,6 +294,9 @@
 			log.infof("bs=%d, whole size=%d, hb=%d, fb=%d, blocks=%d\n", blockSize, size,
 					headerBlocks, fileBlocks, totalBlocks);
+			if (headerBlocks > SLOTS_PER_ENTRY)
+				continue;
 			if (totalBlocks > 0xfffe)
mkgmap-dev mailing list

Reply via email to