Jump to content
  • Advertisement
Sign in to follow this  
xdotdt

a zip library bug?

This topic is 4238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Thanks in advance. I'm using ZipArchive library to patch and archive game asset files. Make packages and patch from it using that library. Today, I got a problem. When I made a package for this version of client, a certain file archived from 244699 bytes to 65549 bytes. I succeeded to make that package. But the problem happened after I patched from it. My game tried to read that file from the packed zip file that has asset files. An exception happened when the library called CloseFile function that is used to close a zip file after reading data from the file. I debugged and I found that the problem was because of ReadFile function. ReadFile function reads data from a zip file separating archived data into the buffer size which is 65536 bytes and extracting the buffer data to the specific storage space. The file which caused the problem has 65549 bytes. After reading the 12 byte header for that file, only 65537 bytes are left to extract. In ReadFile function, Inflate function seems to extract that 65536 byte data. After Inflate function call, there must be 1 byte left. But Inflate function made m_info.m_stream.avail_out zero, which is used as a condition for a loop like this 'while(m_info.m_stream.avail_out>0)'. Did anyone experienced similar problems to this situation?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!