Bug 401638 - Fix missing function tag error on valid gcda file.

Do not attempt to interpret the next four bytes of an unused level
(tag labelled as zero) as the corresponding data length. These
actually represent a seperate tag.

This is cherry-pick from master reviewed here;

	https://git.eclipse.org/r/13628

Change-Id: Id5c1efa3f9aaf836e4f894829f2a362f13aa83f6
Reviewed-on: https://git.eclipse.org/r/14078
Tested-by: Hudson CI
Reviewed-by: Xavier Raynaud <xavier.raynaud@kalray.eu>
IP-Clean: Xavier Raynaud <xavier.raynaud@kalray.eu>
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
index 046cb17..aef541f 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcdaRecordsParser.java
@@ -83,6 +83,15 @@
 			try {
 				// parse header
 				int tag = stream.readInt();
+
+				/*
+				 * Move on to the next tag if an unused level (tag == O) is encountered,
+				 * these do no have corresponding data lengths.
+				 */
+				if(tag == 0){
+					continue;
+				}
+
 				long length = (stream.readInt() &  MasksGenerator.UNSIGNED_INT_MASK);
 				// parse gcda data
 				switch (tag) {