Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gimp

[zlib] Z_BUF_ERROR on Inflate call

This topic is 5603 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

I''m getting this error intermittently in my zip file reader. I cant seem to find the cause of it. In a winzip created zip file for example I get failures on file 32 of a 79 file archive, etc. There appears to me no pattern to the failures. I read in the FileHeader which gives me the compressed and uncompressed sizes. I pass those in to the zstream
  
z_stream stream;
stream.next_in = (Bytef*)CurrentLocation;
stream.avail_in = (uInt)FileHeader.cSize;
stream.next_out = (Bytef*)Buffer;
stream.avail_out = FileHeader.ucSize;
stream.zalloc = Z_NULL;
stream.zfree = Z_NULL;
  
I have also used winzip to confirm these two sizes were being read in correctly and it appears that my sizes match winzip. I just don''t get it. I''m sure I read the pkware spec correctly and I don''t get why I can get the first 30 files correctly but fail on the 31st. There is nothing wrong with the archive, winzip opens it fine, my library fails on other zip files at other random points as well. Is there any tricks I need to know about? I read some vague reference to need an extra byte or something in the decompression buffer... Many thanks, Chris

Share this post


Link to post
Share on other sites
Advertisement

  • 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!