Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stbi__parse_png_file() seek to the byte just after the IEND chunk #1751

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RECENT REVISION HISTORY:
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski
Phil Jordan Dave Moore Roy Eltham
Hayaki Saito Nathan Reed Won Chun
Hayaki Saito Nathan Reed Won Chun Thomas Bernard
Luke Graham Johan Duparc Nick Verigakis the Horde3D community
Thomas Ruf Ronny Chevalier github:rlyeh
Janez Zemva John Bartholomew Michal Cichon github:romigrou
Expand Down Expand Up @@ -5235,6 +5235,10 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
STBI_FREE(z->expanded); z->expanded = NULL;
// end of PNG chunk, read and skip CRC
stbi__get32be(s);
if (s->io.skip && s->img_buffer_end > s->img_buffer) {
// rewind the additional bytes that have been read to the buffer
(s->io.skip)(s->io_user_data, (int)(s->img_buffer - s->img_buffer_end));
}
return 1;
}

Expand Down