summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-12-03 02:01:51 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-12-03 02:01:51 +0000
commit661ff2d5582abfa2d9157de6dd1da18f8464a4e5 (patch)
tree03bb807399f8d459e0b64c4fbbc578e917a57cec
parent3875815d55ee5d107ce2b24f58e2191e23457ca7 (diff)
parente0c45acc6bb833bbb7cc22de03e6cdb7cc43b499 (diff)
Snap for 9364794 from e0c45acc6bb833bbb7cc22de03e6cdb7cc43b499 to tm-qpr2-release
Change-Id: Ie7f55c20f89854c0f708f3e955462036db3fd57a
-rw-r--r--third_party/zip/writer.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/third_party/zip/writer.go b/third_party/zip/writer.go
index f5268385d..8a957e163 100644
--- a/third_party/zip/writer.go
+++ b/third_party/zip/writer.go
@@ -162,9 +162,17 @@ func (w *Writer) Close() error {
if records > uint16max {
records = uint16max
}
+ // Only store uint32max for the size and the offset if they don't fit.
+ // Robolectric currently doesn't support zip64 and fails to find the
+ // offset to the central directory when the number of files in the zip
+ // is larger than 2^16.
+ if size > uint32max {
+ size = uint32max
+ }
+ if offset > uint32max {
+ offset = uint32max
+ }
// END ANDROID CHANGE
- size = uint32max
- offset = uint32max
}
// write end record