+#if ENABLE_FEATURE_UNZIP_BZIP2
+ else if (zip->fmt.method == 12) {
+ /* Tested. Unpacker reads too much, but we use CDF
+ * and will seek to the correct beginning of next file.
+ */
+ xstate.bytes_out = unpack_bz2_stream(&xstate);
+ if (xstate.bytes_out < 0)
+ bb_error_msg_and_die("inflate error");
+ }
+#endif
+#if ENABLE_FEATURE_UNZIP_LZMA
+ else if (zip->fmt.method == 14) {
+ /* Not tested yet */
+ xstate.bytes_out = unpack_lzma_stream(&xstate);
+ if (xstate.bytes_out < 0)
+ bb_error_msg_and_die("inflate error");
+ }
+#endif
+ else {
+ bb_error_msg_and_die("unsupported method %u", zip->fmt.method);
+ }
+
+ /* Validate decompression - size */
+ if (zip->fmt.ucmpsize != xstate.bytes_out) {
+ /* Don't die. Who knows, maybe len calculation
+ * was botched somewhere. After all, crc matched! */
+ bb_error_msg("bad length");
+ }