Many files:
  Checked in e2fsprogs 1.09

diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c
index 4bfc91d..65c129f 100644
--- a/lib/ext2fs/alloc_tables.c
+++ b/lib/ext2fs/alloc_tables.c
@@ -35,6 +35,9 @@
 	group_blk = fs->super->s_first_data_block;
 	for (i = 0; i < fs->group_desc_count; i++) {
 		last_blk = group_blk + fs->super->s_blocks_per_group;
+		if (last_blk >= fs->super->s_blocks_count)
+			last_blk = fs->super->s_blocks_count - 1;
+
 		/*
 		 * Allocate the inode table
 		 */