diff options
author | Lode <lvandeve@gmail.com> | 2014-11-21 01:52:20 +0100 |
---|---|---|
committer | Lode <lvandeve@gmail.com> | 2014-11-21 01:52:20 +0100 |
commit | fe4e8b3693d489bf4b7d2711893075afd047a607 (patch) | |
tree | 2529f7abee1478a5f7ed442f6723529837e29f5a /lodepng_util.cpp | |
parent | 6e1667e71a79dd57bf2bb04edd517a03af51aa90 (diff) |
fix examples
Diffstat (limited to 'lodepng_util.cpp')
-rw-r--r-- | lodepng_util.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lodepng_util.cpp b/lodepng_util.cpp index ed054f0..37a6e73 100644 --- a/lodepng_util.cpp +++ b/lodepng_util.cpp @@ -52,7 +52,7 @@ unsigned getChunkInfo(std::vector<std::string>& names, std::vector<size_t>& size if(std::string(type).size() != 4) return 1; unsigned length = lodepng_chunk_length(chunk); - if(chunk + length >= end) return 1; + if(chunk + length + 12 > end) return 1; names.push_back(type); sizes.push_back(length); @@ -182,7 +182,7 @@ unsigned getFilterTypesInterlaced(std::vector<std::vector<unsigned char> >& filt { const unsigned char* cdata = lodepng_chunk_data_const(chunk); unsigned clength = lodepng_chunk_length(chunk); - if(chunk + clength >= end) return 1; // corrupt chunk length + if(chunk + clength + 12 > end) return 1; // corrupt chunk length for(unsigned i = 0; i < clength; i++) { |