diff options
author | Pierre Joye <pierre.php@gmail.com> | 2021-07-19 13:28:34 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 13:28:34 +0700 |
commit | edaf39fe6fb0d1867b9b5992efb9fe4102138553 (patch) | |
tree | 665e7d658b2fcc84c2055beec3bcd2507151449d /src | |
parent | 98bdb211d359a6d41dcf2f6102386ec4d56f3b29 (diff) | |
parent | 8b111b2b4a4842179be66db68d84dda91a246032 (diff) | |
download | libgd-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.c | 6 |
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; |