summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLode <lvandeve@gmail.com>2016-05-01 16:48:13 +0200
committerLode <lvandeve@gmail.com>2016-05-01 16:48:13 +0200
commitc6cf08b8910d91b0830666c07845116df1e9b6fc (patch)
tree7ee54248f63bd4aedd5c202af1a9b776aefcadb6
parent9b611e386ea2ca694ae9dfecf299b76650100e9b (diff)
fix encoding PNGs of large dimensions
-rw-r--r--lodepng.cpp6
-rw-r--r--lodepng.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index 7e80f11..fcad93e 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -1,5 +1,5 @@
/*
-LodePNG version 20160418
+LodePNG version 20160501
Copyright (c) 2005-2016 Lode Vandevenne
@@ -39,7 +39,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for
#pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/
#endif /*_MSC_VER */
-const char* LODEPNG_VERSION_STRING = "20160418";
+const char* LODEPNG_VERSION_STRING = "20160501";
/*
This source file is built up in the following large parts. The code sections
@@ -5677,7 +5677,7 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize,
if(!lodepng_color_mode_equal(&state->info_raw, &info.color))
{
unsigned char* converted;
- size_t size = (w * h * lodepng_get_bpp(&info.color) + 7) / 8;
+ size_t size = (w * h * (size_t)lodepng_get_bpp(&info.color) + 7) / 8;
converted = (unsigned char*)lodepng_malloc(size);
if(!converted && size) state->error = 83; /*alloc fail*/
diff --git a/lodepng.h b/lodepng.h
index ee08cea..94e8195 100644
--- a/lodepng.h
+++ b/lodepng.h
@@ -1,5 +1,5 @@
/*
-LodePNG version 20160418
+LodePNG version 20160501
Copyright (c) 2005-2016 Lode Vandevenne