diff options
Diffstat (limited to 'example_png_info.cpp')
-rw-r--r-- | example_png_info.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/example_png_info.cpp b/example_png_info.cpp index f5958d8..cd2eca6 100644 --- a/example_png_info.cpp +++ b/example_png_info.cpp @@ -239,7 +239,7 @@ void displayFilterTypes(const std::vector<unsigned char>& buffer, bool ignore_ch { const unsigned char* cdata = lodepng_chunk_data_const(chunk); unsigned clength = lodepng_chunk_length(chunk); - if(chunk + clength + 12 > end) { + if(chunk + clength + 12 > end || clength > buffer.size() || chunk + clength + 12 < begin) { std::cout << "invalid chunk length" << std::endl; return; } |