From 104e4a4bd3638684d631003b2a3665902234f2bf Mon Sep 17 00:00:00 2001 From: richardlehane Date: Fri, 27 Nov 2015 16:53:31 +1100 Subject: [PATCH] minifat fix --- streams.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streams.go b/streams.go index c7ba17b..2186423 100644 --- a/streams.go +++ b/streams.go @@ -17,12 +17,12 @@ package mscfb // set the ministream FAT and sector slices in the header func (r *Reader) setMiniStream() error { // do nothing if there is no ministream - if r.File[0].startingSectorLoc == endOfChain || r.header.miniFatSectorLoc == endOfChain { + if r.File[0].startingSectorLoc == endOfChain || r.header.miniFatSectorLoc == endOfChain || r.header.numMiniFatSectors == 0 { return nil } // build a slice of minifat sectors (akin to the DIFAT slice) c := int(r.header.numMiniFatSectors) - if c <= 0 { + if c < 0 { return ErrFormat } r.header.miniFatLocs = make([]uint32, c)