diff --git a/src/reader_struct.h b/src/reader_struct.h index c26dfda0..d247714a 100644 --- a/src/reader_struct.h +++ b/src/reader_struct.h @@ -267,13 +267,17 @@ struct Primitive { ref = stream.ReadInt(); #ifdef LCF_DEBUG_TRACE fprintf(stderr, " %d\n", ref); +#endif + } else if (length == 0) { + ref = 0; +#ifdef LCF_DEBUG_TRACE + fprintf(stderr, " %d\n", ref); #endif } else { ref = 0; Log::Warning("Invalid integer at %X", stream.Tell()); stream.Seek(length, LcfReader::FromCurrent); } - } static void WriteLcf(const int32_t& ref, LcfWriter& stream) { stream.WriteInt(ref);