File tree 1 file changed +13
-2
lines changed
src/ICSharpCode.SharpZipLib/Zip
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,21 @@ public bool CanDecompressEntry
131
131
{
132
132
get
133
133
{
134
- return ( entry != null ) && entry . CanDecompress ;
134
+ return ( entry != null ) && IsEntryCompressionMethodSupported ( entry ) && entry . CanDecompress ;
135
135
}
136
136
}
137
137
138
+ /// <summary>
139
+ /// Is the compression method for the specified entry supported?
140
+ /// </summary>
141
+ /// <param name="entry"></param>
142
+ /// <returns></returns>
143
+ private static bool IsEntryCompressionMethodSupported ( ZipEntry entry )
144
+ {
145
+ return entry . CompressionMethod == CompressionMethod . Deflated ||
146
+ entry . CompressionMethod == CompressionMethod . Stored ;
147
+ }
148
+
138
149
/// <summary>
139
150
/// Advances to the next entry in the archive
140
151
/// </summary>
@@ -271,7 +282,7 @@ public ZipEntry GetNextEntry()
271
282
}
272
283
273
284
// Determine how to handle reading of data if this is attempted.
274
- if ( entry . IsCompressionMethodSupported ( ) )
285
+ if ( IsEntryCompressionMethodSupported ( entry ) )
275
286
{
276
287
internalReader = new ReadDataHandler ( InitialRead ) ;
277
288
}
You can’t perform that action at this time.
0 commit comments