Skip to content

Commit

Permalink
minifat fix
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlehane committed Nov 27, 2015
1 parent 67b38e8 commit 104e4a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 104e4a4

Please sign in to comment.