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 read out-of-bounds in reading tga header file #711

Merged
merged 1 commit into from Jul 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
fix read out-of-bands in reading tga header file
  • Loading branch information
meweez committed Jul 19, 2021
commit 8b111b2b4a4842179be66db68d84dda91a246032
6 changes: 5 additions & 1 deletion src/gd_tga.c
Expand Up @@ -191,7 +191,11 @@ int read_header_tga(gdIOCtx *ctx, oTga *tga)
return -1;
}

gdGetBuf(tga->ident, tga->identsize, ctx);

if (gdGetBuf(tga->ident, tga->identsize, ctx) != tga->identsize) {
gd_error("fail to read header ident");
return -1;
}
}

return 1;
Expand Down