app: aboot: add check on sparse header size

Return if the file_hdr_sz field of sparse
header does not matches with the size of
the sparse header structure

Change-Id: Ia54a3e32ae34f69c351253dac133a664603addee
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 5ff06ca..395196f 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1750,13 +1750,11 @@
 		return;
 	}
 
-	data += sparse_header->file_hdr_sz;
-	if(sparse_header->file_hdr_sz > sizeof(sparse_header_t))
+	data += sizeof(sparse_header_t);
+	if(sparse_header->file_hdr_sz != sizeof(sparse_header_t))
 	{
-		/* Skip the remaining bytes in a header that is longer than
-		 * we expected.
-		 */
-		data += (sparse_header->file_hdr_sz - sizeof(sparse_header_t));
+		fastboot_fail("sparse header size mismatch");
+		return;
 	}
 
 	dprintf (SPEW, "=== Sparse Image Header ===\n");