diff --git a/cmd/screp/screp.go b/cmd/screp/screp.go index 13ff3c1..7576fe0 100644 --- a/cmd/screp/screp.go +++ b/cmd/screp/screp.go @@ -24,7 +24,7 @@ import ( const ( appName = "screp" - appVersion = "v1.11.0" + appVersion = "v1.11.1" appAuthor = "Andras Belicza" appHome = "https://github.com/icza/screp" ) diff --git a/repparser/repdecoder/modern.go b/repparser/repdecoder/modern.go index e2f7ed7..7516c29 100644 --- a/repparser/repdecoder/modern.go +++ b/repparser/repdecoder/modern.go @@ -28,7 +28,7 @@ var knownModernSectionIDSizeHints = map[int32]int32{ func (d *modernDecoder) Section(size int32) (result []byte, sectionID int32, err error) { if d.sectionsCounter > 5 { // These are the sections added in modern replays. - if sectionID, err = d.readInt32(); err != nil { // This is the StrID of the section, not checking it + if sectionID, err = d.readInt32(); err != nil { // This is the StrID of the section return } var rawSize int32 diff --git a/repparser/repparser.go b/repparser/repparser.go index e4810fb..7857bbe 100644 --- a/repparser/repparser.go +++ b/repparser/repparser.go @@ -60,7 +60,7 @@ import ( const ( // Version is a Semver2 compatible version of the parser. - Version = "v1.11.0" + Version = "v1.11.1" ) var ( @@ -247,6 +247,11 @@ func parse(dec repdecoder.Decoder, cfg Config) (*rep.Replay, error) { if err == io.EOF { break // New sections with StrID are optional } + if sectionCounter >= len(Sections) { + // If we got "enough" info, just log the error: + log.Printf("Warning: Decoder.Section() error: %v", err) + break + } return nil, fmt.Errorf("Decoder.Section() error: %w", err) }