Skip to content

Commit

Permalink
zip: Fix nested decode for none compress
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Nov 21, 2021
1 parent 0480a2f commit 9029143
Show file tree
Hide file tree
Showing 9 changed files with 1,854 additions and 1,220 deletions.
Binary file added format/zip/testdata/.DS_Store
Binary file not shown.
1,046 changes: 633 additions & 413 deletions format/zip/testdata/test-macos.fqtest

Large diffs are not rendered by default.

Binary file modified format/zip/testdata/test-macos.zip
Binary file not shown.
Binary file added format/zip/testdata/test/b.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,013 changes: 609 additions & 404 deletions format/zip/testdata/test0.fqtest

Large diffs are not rendered by default.

Binary file modified format/zip/testdata/test0.zip
Binary file not shown.
1,011 changes: 609 additions & 402 deletions format/zip/testdata/test9.fqtest

Large diffs are not rendered by default.

Binary file modified format/zip/testdata/test9.zip
Binary file not shown.
4 changes: 3 additions & 1 deletion format/zip/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ func zipDecode(d *decode.D, in interface{}) interface{} {
}

if compressionMethod == compressionMethodNone {
d.FieldRawLen("uncompressed", compressedSize)
if dv, _, _ := d.FieldTryFormatLen("uncompressed", compressedSize, probeFormat, nil); dv == nil {
d.FieldRawLen("uncompressed", compressedSize)
}
} else {
var rFn func(r io.Reader) io.Reader
switch compressionMethod {
Expand Down

0 comments on commit 9029143

Please sign in to comment.