File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,16 +170,10 @@ func newFile() *File {
170170// reader.
171171func (f * File ) checkOpenReaderOptions () error {
172172 if f .options .UnzipSizeLimit == 0 {
173- f .options .UnzipSizeLimit = UnzipSizeLimit
174- if f .options .UnzipXMLSizeLimit > f .options .UnzipSizeLimit {
175- f .options .UnzipSizeLimit = f .options .UnzipXMLSizeLimit
176- }
173+ f .options .UnzipSizeLimit = max (f .options .UnzipXMLSizeLimit , UnzipSizeLimit )
177174 }
178175 if f .options .UnzipXMLSizeLimit == 0 {
179- f .options .UnzipXMLSizeLimit = StreamChunkSize
180- if f .options .UnzipSizeLimit < f .options .UnzipXMLSizeLimit {
181- f .options .UnzipXMLSizeLimit = f .options .UnzipSizeLimit
182- }
176+ f .options .UnzipXMLSizeLimit = min (f .options .UnzipSizeLimit , StreamChunkSize )
183177 }
184178 if f .options .UnzipXMLSizeLimit > f .options .UnzipSizeLimit {
185179 return ErrOptionsUnzipSizeLimit
You can’t perform that action at this time.
0 commit comments