fix read out-of-bands in reading tga header file

master
maryam ebrahimzadeh 2021-07-19 10:07:13 +04:30
parent 98bdb211d3
commit 8b111b2b4a
1 changed files with 5 additions and 1 deletions

View File

@ -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;