Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 16e0741

Browse files
committed
Update lodepng_util.cpp to the latest version
1 parent decff78 commit 16e0741

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/zopflipng/lodepng/lodepng_util.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ unsigned getChunks(std::vector<std::string> names[3],
9595
{
9696
location = 2;
9797
}
98-
else if(name != "IEND")
98+
else if(name == "IEND")
99+
{
100+
break; // anything after IEND is not part of the PNG or the 3 groups here.
101+
}
102+
else
99103
{
104+
if(next > end) return 1; // invalid chunk, content too far
100105
names[location].push_back(name);
101106
chunks[location].push_back(std::vector<unsigned char>(chunk, next));
102107
}

0 commit comments

Comments
 (0)