mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
Merge "tiffdec: check error returns for width/height"
This commit is contained in:
commit
2b9048e324
@ -40,8 +40,11 @@ int ReadTIFF(const char* const filename,
|
|||||||
dircount - 1);
|
dircount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
|
if (!(TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width) &&
|
||||||
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
|
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height))) {
|
||||||
|
fprintf(stderr, "Error! Cannot retrieve TIFF image dimensions.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
raster = (uint32*)_TIFFmalloc(width * height * sizeof(*raster));
|
raster = (uint32*)_TIFFmalloc(width * height * sizeof(*raster));
|
||||||
if (raster != NULL) {
|
if (raster != NULL) {
|
||||||
if (TIFFReadRGBAImageOriented(tif, width, height, raster,
|
if (TIFFReadRGBAImageOriented(tif, width, height, raster,
|
||||||
|
Loading…
Reference in New Issue
Block a user