summaryrefslogtreecommitdiff
path: root/pngdetail.cpp
diff options
context:
space:
mode:
authorLode <lvandeve@gmail.com>2018-01-16 00:14:49 +0100
committerLode <lvandeve@gmail.com>2018-01-16 00:14:49 +0100
commit93e348fc8ee50729b2bfc3d602df2cae6051a40e (patch)
treee6a58ce56e3a811f15c1c92c5bb2e5de14896c46 /pngdetail.cpp
parentd4d8f1aa786571af4a90a41b3db048043f114629 (diff)
display more info for corrupt pngs
Diffstat (limited to 'pngdetail.cpp')
-rw-r--r--pngdetail.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/pngdetail.cpp b/pngdetail.cpp
index 00aa9dd..b11d78c 100644
--- a/pngdetail.cpp
+++ b/pngdetail.cpp
@@ -184,7 +184,13 @@ void displayChunkNames(const std::vector<unsigned char>& buffer, const Options&
std::vector<std::string> names;
std::vector<size_t> sizes;
unsigned error = lodepng::getChunkInfo(names, sizes, buffer);
- if(error) std::cout << "Error while identifying chunks. Listing identified chunks anyway." << std::endl;
+ if(error) {
+ if(!names.empty() && names.back() == "IEND" && sizes.back() == 0) {
+ std::cout << "Corruption or superfluous data detected after the IEND chunk" << std::endl;
+ } else {
+ std::cout << "Error while identifying chunks. Listing identified chunks anyway." << std::endl;
+ }
+ }
if(options.show_chunks2)
{