diff options
author | Lode <lvandeve@gmail.com> | 2014-11-18 23:37:42 +0100 |
---|---|---|
committer | Lode <lvandeve@gmail.com> | 2014-11-18 23:37:42 +0100 |
commit | ba274d5b98d1582bba47a1591c9e02b1ff421352 (patch) | |
tree | 63a82d5e567b17bc140d67119ce8fd417651b972 /pngdetail.cpp | |
parent | c7353101cea671073ba1a9f4ca9f4cf7e8dbc944 (diff) |
protect against invalid chunk lengths in some tools
Diffstat (limited to 'pngdetail.cpp')
-rw-r--r-- | pngdetail.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pngdetail.cpp b/pngdetail.cpp index b876f71..98f03d2 100644 --- a/pngdetail.cpp +++ b/pngdetail.cpp @@ -304,7 +304,12 @@ Show the filtertypes of each scanline in this PNG image. void displayFilterTypes(const std::vector<unsigned char>& buffer) { std::vector<std::vector<unsigned char> > types; - lodepng::getFilterTypesInterlaced(types, buffer); + unsigned error = lodepng::getFilterTypesInterlaced(types, buffer); + if(error) + { + std::cout << "Error getting filter types" << std::endl; + return; + } if(types.size() == 7) { |