summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLode Vandevenne <lvandeve@users.noreply.github.com>2016-01-24 20:26:47 +0100
committerLode Vandevenne <lvandeve@users.noreply.github.com>2016-01-24 20:26:47 +0100
commit20b1e8f8038504a7d712ee5f0d836f6da6ec43ee (patch)
tree91969172c789c3c1978ea81d2f07dce5252fd2fd
parent2ccff76a584c8e1566779c8daddc757b9bf87a56 (diff)
parent2bec4a63459eaf641abba568932c2d2613e8f225 (diff)
Merge pull request #32 from JeckDev/master
Fixed crash on uncompressed PNG files.
-rw-r--r--lodepng.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index 8665292..8e6e368 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -1768,7 +1768,7 @@ static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash,
else
{
if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/);
- for(i = datapos; i < dataend; ++i) lz77_encoded.data[i] = data[i]; /*no LZ77, but still will be Huffman compressed*/
+ for(i = datapos; i < dataend; ++i) lz77_encoded.data[i-datapos] = data[i]; /*no LZ77, but still will be Huffman compressed*/
}
if(!uivector_resizev(&frequencies_ll, 286, 0)) ERROR_BREAK(83 /*alloc fail*/);