summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2021-07-19 13:28:34 +0700
committerGitHub <noreply@github.com>2021-07-19 13:28:34 +0700
commitedaf39fe6fb0d1867b9b5992efb9fe4102138553 (patch)
tree665e7d658b2fcc84c2055beec3bcd2507151449d /src
parent98bdb211d359a6d41dcf2f6102386ec4d56f3b29 (diff)
parent8b111b2b4a4842179be66db68d84dda91a246032 (diff)
downloadlibgd-edaf39fe6fb0d1867b9b5992efb9fe4102138553.tar.gz
Merge pull request #711 from me22bee/read_header_tga
fix read out-of-bounds 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;