mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Check image size when reading targa file\nThrow an error when image width or height is 0.
This commit is contained in:
parent
043bbb07d4
commit
5170cf3b55
1 changed files with 2 additions and 1 deletions
3
BeefySysLib/third_party/jpeg/rdtarga.c
vendored
3
BeefySysLib/third_party/jpeg/rdtarga.c
vendored
|
@ -363,7 +363,8 @@ start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
|||
if (cmaptype > 1 || /* cmaptype must be 0 or 1 */
|
||||
source->pixel_size < 1 || source->pixel_size > 4 ||
|
||||
(UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */
|
||||
interlace_type != 0) /* currently don't allow interlaced image */
|
||||
interlace_type != 0 || /* currently don't allow interlaced image */
|
||||
width == 0 || height == 0) /* image width/height must be non-zero */
|
||||
ERREXIT(cinfo, JERR_TGA_BADPARMS);
|
||||
|
||||
if (subtype > 8) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue