1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 18:56:52 +03:00

zip: Fix nested decode for none compress

This commit is contained in:
Mattias Wadman 2021-11-21 12:01:09 +01:00
parent 0480a2f722
commit 9029143acc
9 changed files with 1854 additions and 1220 deletions

BIN
format/zip/testdata/.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
format/zip/testdata/test/b.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -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 {