]> git.saurik.com Git - wxWidgets.git/blobdiff - src/tiff/tools/bmp2tiff.c
Merged libtiff 4.0.3 changes into the trunk.
[wxWidgets.git] / src / tiff / tools / bmp2tiff.c
index 08d991754811723bb515d6ec196e0e5ffc4c8e34..2e1e430ae96ae858627eaf520eb05d7f98f580a3 100644 (file)
 # include <io.h>
 #endif
 
+#ifdef NEED_LIBPORT
+# include "libport.h"
+#endif
+
 #include "tiffio.h"
 
 #ifndef O_BINARY
@@ -428,7 +432,7 @@ main(int argc, char* argv[])
                                read(fd, clr_tbl, n_clr_elems * clr_tbl_size);
 
                                red_tbl = (unsigned short*)
-                                       _TIFFmalloc(1<<depth * sizeof(unsigned short));
+                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
                                if (!red_tbl) {
                                        TIFFError(infilename,
                                "Can't allocate space for red component table");
@@ -436,7 +440,7 @@ main(int argc, char* argv[])
                                        goto bad1;
                                }
                                green_tbl = (unsigned short*)
-                                       _TIFFmalloc(1<<depth * sizeof(unsigned short));
+                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
                                if (!green_tbl) {
                                        TIFFError(infilename,
                                "Can't allocate space for green component table");
@@ -444,7 +448,7 @@ main(int argc, char* argv[])
                                        goto bad2;
                                }
                                blue_tbl = (unsigned short*)
-                                       _TIFFmalloc(1<<depth * sizeof(unsigned short));
+                                       _TIFFmalloc(((tmsize_t)1)<<depth * sizeof(unsigned short));
                                if (!blue_tbl) {
                                        TIFFError(infilename,
                                "Can't allocate space for blue component table");
@@ -841,3 +845,10 @@ usage(void)
 }
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 8
+ * fill-column: 78
+ * End:
+ */