From ba274d5b98d1582bba47a1591c9e02b1ff421352 Mon Sep 17 00:00:00 2001 From: Lode Date: Tue, 18 Nov 2014 23:37:42 +0100 Subject: protect against invalid chunk lengths in some tools --- pngdetail.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pngdetail.cpp') 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& buffer) { std::vector > 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) { -- cgit v1.2.3