[xml] zlib 1.2.1 problems(?) + fix




I thought this might be worth of mentioning. 
I am a follower of the arcade emulation scence and the zlib is used in a
few projects attached to it and there have been reports, that the zlib
1.2.1 has problems with extracting files and I also remember something
else. In the actual MAME 0.86 source you can find the fix for offical
distribution. You can also easily look at it in the MESS CVS:

http://cvs.mess.org:6502/cgi-bin/viewcvs.cgi/src/zlib/inftrees.c.diff?r1=1.1&r2=1.2

===================================================================
RCS file: /home/cvs/mess/src/zlib/inftrees.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- src/zlib/inftrees.c 2004/07/28 02:50:05     1.1
+++ src/zlib/inftrees.c 2004/08/21 15:20:04     1.2
@@ -114,7 +114,15 @@
     for (max = MAXBITS; max >= 1; max--)
         if (count[max] != 0) break;
     if (root > max) root = max;
-    if (max == 0) return -1;            /* no codes! */
+    if (max == 0) {                     /* no symbols to code at all */
+        this.op = (unsigned char)64;    /* invalid code marker */
+        this.bits = (unsigned char)1;
+        this.val = (unsigned short)0;
+        *(*table)++ = this;           /* make a table to force an error
*/
+        *(*table)++ = this;
+        *bits = 1;
+        return 0;     /* no symbols, but wait for decoding to report
error */
+    }
     for (min = 1; min <= MAXBITS; min++)
         if (count[min] != 0) break;
     if (root < min) root = min;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]