Skip to content

Commit 5b57878

Browse files
committed
lyb parser BUGFIX properly skipping lyb chunks
1 parent a3e312c commit 5b57878

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/parser_lyb.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,14 @@ lyb_skip_subtree(const char *data, struct lyb_state *lybs)
995995
int r, ret = 0;
996996

997997
do {
998-
ret += (r = lyb_read(data, NULL, lybs->written[lybs->used - 1], lybs));
999-
LYB_HAVE_READ_RETURN(r, data, -1);
1000-
1001-
/* also skip the meta information inside */
998+
/* first skip any meta information inside */
1002999
r = lybs->inner_chunks[lybs->used - 1] * LYB_META_BYTES;
10031000
data += r;
10041001
ret += r;
1002+
1003+
/* then read data */
1004+
ret += (r = lyb_read(data, NULL, lybs->written[lybs->used - 1], lybs));
1005+
LYB_HAVE_READ_RETURN(r, data, -1);
10051006
} while (lybs->written[lybs->used - 1]);
10061007

10071008
return ret;

0 commit comments

Comments
 (0)