--- a/ImageRdr.st Sun Jan 25 15:11:43 1998 +0100
+++ b/ImageRdr.st Sun Jan 25 15:12:36 1998 +0100
@@ -785,13 +785,21 @@
fin = curCode;
outCode[outCount++] = fin;
+#if 0
if ((to+outCount) >= toEnd) {
fprintf(stderr, "ImageReader [warning]: GIF outBuffer overrun\n");
ret = 0;
break;
}
- for (i = outCount - 1; i >= 0; i--)
+#endif
+ for (i = outCount - 1; i >= 0; i--) {
+ if (to >= toEnd) {
+ fprintf(stderr, "ImageReader [warning]: GIF outBuffer overrun\n");
+ ret = 0;
+ break;
+ }
*to++ = outCode[i];
+ }
outCount = 0;
prefix[freeCode] = oldCode;
@@ -1936,5 +1944,5 @@
!ImageReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.58 1998-01-19 17:16:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.59 1998-01-25 14:12:36 cg Exp $'
! !
--- a/ImageReader.st Sun Jan 25 15:11:43 1998 +0100
+++ b/ImageReader.st Sun Jan 25 15:12:36 1998 +0100
@@ -785,13 +785,21 @@
fin = curCode;
outCode[outCount++] = fin;
+#if 0
if ((to+outCount) >= toEnd) {
fprintf(stderr, "ImageReader [warning]: GIF outBuffer overrun\n");
ret = 0;
break;
}
- for (i = outCount - 1; i >= 0; i--)
+#endif
+ for (i = outCount - 1; i >= 0; i--) {
+ if (to >= toEnd) {
+ fprintf(stderr, "ImageReader [warning]: GIF outBuffer overrun\n");
+ ret = 0;
+ break;
+ }
*to++ = outCode[i];
+ }
outCount = 0;
prefix[freeCode] = oldCode;
@@ -1936,5 +1944,5 @@
!ImageReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.58 1998-01-19 17:16:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.59 1998-01-25 14:12:36 cg Exp $'
! !