Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
02180 Core Feature Always Aug 30, 2008, 11:14 Mar 4, 2009, 21:33
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To couriersud Resolution Fixed OS Windows XP/Vista 64-bit
Status [?] Resolved Driver
Version 0.127u1 Fixed in Version 0.129u6 Build Debug
Fixed in Git Commit Github Pull Request #
Summary 02180: Corrupt archives are read without problems
Description I got a corrupt rom archive, that reports a CRC error when extracted with archive tools like WinRAR or 7-Zip, but MAME loads it without a warning. So the game, that should be working actually has serious graphical issues and hangs.

I used gridless as example as this set is freely available through mamedev.org. The file in question here is "gridfnle.bin".
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
zip file icon gridlee.zip (25,080 bytes) Aug 30, 2008, 11:14
Relationships
related to 02126Resolvedaaron corrupt CHDs are reported as missing 
Notes
3
User avatar
No.02277
Tafoid
Administrator
Aug 30, 2008, 16:01
edited on: Aug 31, 2008, 03:22
Here is some output from WinZip from windows upon testing the archive which loads fine in MAME:

Errors were detected -- see below for details
 
Testing ...
testing: grdbprom.bin             OK
testing: grdgprom.bin             OK
testing: grdrprom.bin             OK
testing: gridfnla.bin             OK
testing: gridfnlb.bin             OK
testing: gridfnlc.bin             OK
testing: gridfnld.bin             OK
testing: gridfnle.bin            Error:  invalid compressed data to inflate
testing: gridfnlf.bin             OK
testing: gridpix0.bin             OK
testing: gridpix1.bin             OK
testing: gridpix2.bin             OK
testing: gridpix3.bin             OK
At least one error was detected in C:\Documents and Settings\Administrator\Desktop\mametry\roms\gridlee.zip.
User avatar
No.03732
Firewave
Senior Tester
Feb 8, 2009, 12:03
I looked into this issue again I recognised some issues with load_zipped_file():

- when core_fopen_ram() fails, file->zipfile is not being closed and invalidated
- the returnvalue of load_zipped_file() is never checked
- IIRC zip_file_decompress() will return a valid file->zipfile and file->zipdata even if an error occured, so it has to be free'd and invalidated (this might the actual issue causing the problem)
User avatar
No.03733
Firewave
Senior Tester
Feb 8, 2009, 12:13
I can confirm, that my observation was right. I added some printfs and tested it with a corrupt archive and I got this output:

zip_file_decompress() failed - 4 - 0C9E1F80 - 0DAB1000 - 524288
zip_file_decompress() failed - 4 - 0C9E1F80 - 0DA21000 - 524288
zip_file_decompress() failed - 4 - 0C9E1F80 - 0DA21000 - 524288

So all the pointers are valid, although the decompression caused an error.