summaryrefslogtreecommitdiff
path: root/backend/escl/escl_tiff.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
commite0d94cf4d39395df1e2c6bb4d967200298c13881 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /backend/escl/escl_tiff.c
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
Update upstream source from tag 'upstream/1.2.1'
Update to upstream version '1.2.1' with Debian dir a9bb43f754a5c9a361b076af3635cc767b7e652e
Diffstat (limited to 'backend/escl/escl_tiff.c')
-rw-r--r--backend/escl/escl_tiff.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/backend/escl/escl_tiff.c b/backend/escl/escl_tiff.c
index e33498c..e17554e 100644
--- a/backend/escl/escl_tiff.c
+++ b/backend/escl/escl_tiff.c
@@ -26,6 +26,8 @@
#include "escl.h"
+#include "../include/_stdint.h"
+
#include "../include/sane/sanei.h"
#include <stdio.h>
@@ -53,11 +55,11 @@ SANE_Status
get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
{
TIFF* tif = NULL;
- uint32 w = 0;
- uint32 h = 0;
+ uint32_t w = 0;
+ uint32_t h = 0;
unsigned char *surface = NULL; /* image data*/
int components = 4;
- uint32 npixels = 0;
+ uint32_t npixels = 0;
SANE_Status status = SANE_STATUS_GOOD;
lseek(fileno(scanner->tmp), 0, SEEK_SET);
@@ -71,15 +73,15 @@ get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
npixels = w * h;
- surface = (unsigned char*) malloc(npixels * sizeof (uint32));
- if (surface != NULL)
+ surface = (unsigned char*) malloc(npixels * sizeof (uint32_t));
+ if (surface == NULL)
{
DBG( 1, "Escl Tiff : raster Memory allocation problem.\n");
status = SANE_STATUS_INVAL;
goto close_tiff;
}
- if (!TIFFReadRGBAImage(tif, w, h, (uint32 *)surface, 0))
+ if (!TIFFReadRGBAImage(tif, w, h, (uint32_t *)surface, 0))
{
DBG( 1, "Escl Tiff : Problem reading image data.\n");
status = SANE_STATUS_INVAL;