Hi Franco

a resulting bad map : bad_gmapsupp.img
<http://files.mkgmap.org.uk/download/420/bad_gmapsupp.img>

Just one tile less - no problem - good_gmapsupp.img
<http://files.mkgmap.org.uk/download/421/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.

Thanks

..Steve
Index: src/uk/me/parabola/imgfmt/sys/ImgFS.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- 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)
 				continue;
 
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to