Giter Site home page Giter Site logo

[Bug]: BIT7Z_AUTO_FORMAT is fail about bit7z HOT 2 CLOSED

psvajaz avatar psvajaz commented on June 15, 2024
[Bug]: BIT7Z_AUTO_FORMAT is fail

from bit7z.

Comments (2)

rikyoz avatar rikyoz commented on June 15, 2024

Hi!
Thanks for reporting the bug!

After reading the source code, it was found that the file suffix name should be determined first. If the determination is successful, detectFormatFromSig will not be run for file configuration determination, which may cause compressed files to not open properly

I replicated your usage scenario, and indeed bit7z fails to detect the format.
However, the problem is not that detectFormatFromSig is not called.

The BitInputArchive::openArchiveStream method takes into account precisely the case where a format was detected from the extension, but we could not open the archive:

HRESULT res = in_archive->Open( in_stream, nullptr, open_callback );

if ( res != S_OK && mArchiveHandler.format() == BitFormat::Auto && !detected_by_signature ) {
    /* ... */
    mDetectedFormat = &( detectFormatFromSig( in_stream ) );
    ...
}

The actual problem is that, in some cases, the call to Open might change the state of the underlying file stream so that when detectFormatFromSig tries to read the file signature, it fails, hence the format detection error.
I've pushed a commit to the develop branch that fixes this issue.

Thank you again! 🙏

from bit7z.

rikyoz avatar rikyoz commented on June 15, 2024

Fixed in v4.0.0.

from bit7z.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.