summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaryam ebrahimzadeh <maryam.ebr@student.sharif.edu>2021-07-19 10:07:13 +0430
committermaryam ebrahimzadeh <maryam.ebr@student.sharif.edu>2021-07-19 10:07:13 +0430
commit8b111b2b4a4842179be66db68d84dda91a246032 (patch)
tree665e7d658b2fcc84c2055beec3bcd2507151449d /src
parent98bdb211d359a6d41dcf2f6102386ec4d56f3b29 (diff)
downloadlibgd-8b111b2b4a4842179be66db68d84dda91a246032.tar.gz
fix read out-of-bands in reading tga header file
Diffstat (limited to 'src')
-rw-r--r--src/gd_tga.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gd_tga.c b/src/gd_tga.c
index cae9428..286febb 100644
--- a/src/gd_tga.c
+++ b/src/gd_tga.c
@@ -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;