]> git.saurik.com Git - wxWidgets.git/blobdiff - src/tiff/tools/gif2tiff.c
Don't generate any events from wxSpinCtrl and wxSpinCtrlDouble methods.
[wxWidgets.git] / src / tiff / tools / gif2tiff.c
index ae42ba859942772219fc024cff194b066e9a50a2..539e85e8b75810129ac8d851261f84df8c90b8fd 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id$ */
 
 /*
  * Copyright (c) 1990-1997 Sam Leffler
 # include <unistd.h>
 #endif
 
+#ifdef NEED_LIBPORT
+# include "libport.h"
+#endif
+
 #include "tiffio.h"
 
 #define        GIFGAMMA        (1.5)           /* smaller makes output img brighter */
@@ -250,7 +253,7 @@ readscreen(void)
     global = buf[4] & 0x80;
     if (global) {
         globalbits = (buf[4] & 0x07) + 1;
-        fread(globalmap,3,1<<globalbits,infile);
+        fread(globalmap,3,((size_t)1)<<globalbits,infile);
     }
 }
 
@@ -285,7 +288,7 @@ readgifimage(char* mode)
 
         fprintf(stderr, "   local colors: %d\n", 1<<localbits);
 
-        fread(localmap, 3, 1<<localbits, infile);
+        fread(localmap, 3, ((size_t)1)<<localbits, infile);
         initcolors(localmap, 1<<localbits);
     } else if (global) {
         initcolors(globalmap, 1<<globalbits);
@@ -503,6 +506,10 @@ rasterize(int interleaved, char* mode)
     strip = 0;
     stripsize = TIFFStripSize(tif);
     for (row=0; row<height; row += rowsperstrip) {
+       if (rowsperstrip > height-row) {
+           rowsperstrip = height-row;
+           stripsize = TIFFVStripSize(tif, rowsperstrip);
+       }
        if (TIFFWriteEncodedStrip(tif, strip, newras+row*width, stripsize) < 0)
            break;
        strip++;
@@ -513,3 +520,10 @@ rasterize(int interleaved, char* mode)
 }
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 8
+ * fill-column: 78
+ * End:
+ */