Skip to content

Commit

Permalink
Fix crash on files with invalid compression method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Dec 8, 2018
1 parent f86e3f6 commit a66e5c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zipreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ func (zr *ZipReaderFile) Read(p []byte) (int, error) {
}

switch zr.entries[zr.curEntry].method {
case zip.Deflate:
zr.internalReader = flate.NewReader(zr.zipFile)
case zip.Store:
zr.internalReader = zr.zipFile
default: // case zip.Deflate: // Android treats everything but 0 as deflate
zr.internalReader = flate.NewReader(zr.zipFile)
}
}
return zr.internalReader.Read(p)
Expand Down

0 comments on commit a66e5c1

Please sign in to comment.