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 #61 bug exceeding maximum supported memory by limiting image pixel as 32K #63

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
3 changes: 3 additions & 0 deletions src/stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -6320,6 +6320,9 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in
g->ratio = stbi__get8(s);
g->transparent = -1;

// Based on 32K resolution
if (g->w > 30720 || g->h > 17280) return stbi__err("pixel size of GIF is too big", "Too big GIF");

if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments

if (is_info) return 1;
Expand Down