From e5246fad25f28d268777cba4bf9ce3dd1e08eb56 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 27 Jul 2015 19:44:03 -0700 Subject: [PATCH] dump: Fix everything up through dims for version-3 SPV files. version-1 SPVs still report errors. --- dump.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dump.c b/dump.c index aeb26086b0..df633fa660 100644 --- a/dump.c +++ b/dump.c @@ -298,15 +298,16 @@ dump_value_31(FILE *stream) match_byte_assert(0x58); if (match_byte(0x31)) { - /* All the examples in the corpus, all from one SPV file, are - exactly like this. */ + /* Only two SPV files have anything like this, so it's hard to + generalize. */ match_u32_assert(0); match_u32_assert(0); match_u32_assert(0); match_u32_assert(0); match_byte_assert(1); match_byte_assert(0); - match_byte_assert(8); + if (!match_byte(8) && !match_byte(1)) + match_byte_assert(2); match_byte_assert(0); match_byte_assert(8); match_byte_assert(0); @@ -445,7 +446,7 @@ dump_value(FILE *stream, int level, bool match1) char *var, *vallab; double value; - match_byte_assert (0x58); + dump_value_31 (stream); format = get_u32 (); value = get_double (); var = get_string (); @@ -607,7 +608,7 @@ dump_dim(int indx) printf ("\n", indx); dump_value (stdout, 0, false); - /* This byte is usually 0x02 but 0x00 and 0x75 (!) have also been spotted. */ + /* This byte is usually 0x02 but many other values have been spotted. */ pos++; if (!match_byte(0) && !match_byte(1)) -- 2.30.2