--- a/ImageRdr.st Fri Aug 21 19:48:27 1998 +0200
+++ b/ImageRdr.st Fri Aug 21 23:36:48 1998 +0200
@@ -778,6 +778,13 @@
if (outCount > 1024) {
goto out;
}
+
+ /* debugging and protecting myself from overwrites */
+ if (curCode >= 4096) {
+ fprintf(stderr, "ImageReader [warning]: GIF corrupted input (code > 4095)\n");
+ ret = 0;
+ break;
+ }
outCode[outCount++] = suffix[curCode];
curCode = prefix[curCode];
}
@@ -802,6 +809,13 @@
}
outCount = 0;
+ /* debugging and protecting myself from overwrites */
+ if (freeCode >= 4096) {
+ fprintf(stderr, "ImageReader [warning]: GIF corrupted input (freeCode > 4095)\n");
+ ret = 0;
+ break;
+ }
+
prefix[freeCode] = oldCode;
suffix[freeCode] = fin;
oldCode = inCode;
@@ -2055,5 +2069,5 @@
!ImageReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.65 1998-06-15 15:08:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.66 1998-08-21 21:36:48 cg Exp $'
! !
--- a/ImageReader.st Fri Aug 21 19:48:27 1998 +0200
+++ b/ImageReader.st Fri Aug 21 23:36:48 1998 +0200
@@ -778,6 +778,13 @@
if (outCount > 1024) {
goto out;
}
+
+ /* debugging and protecting myself from overwrites */
+ if (curCode >= 4096) {
+ fprintf(stderr, "ImageReader [warning]: GIF corrupted input (code > 4095)\n");
+ ret = 0;
+ break;
+ }
outCode[outCount++] = suffix[curCode];
curCode = prefix[curCode];
}
@@ -802,6 +809,13 @@
}
outCount = 0;
+ /* debugging and protecting myself from overwrites */
+ if (freeCode >= 4096) {
+ fprintf(stderr, "ImageReader [warning]: GIF corrupted input (freeCode > 4095)\n");
+ ret = 0;
+ break;
+ }
+
prefix[freeCode] = oldCode;
suffix[freeCode] = fin;
oldCode = inCode;
@@ -2055,5 +2069,5 @@
!ImageReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.65 1998-06-15 15:08:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.66 1998-08-21 21:36:48 cg Exp $'
! !