|
|
@ -351,16 +351,16 @@ tag_t TIFFGetRawTagListEntry( ctiff_t * ctif, int tagidx ) { |
|
|
|
} |
|
|
|
|
|
|
|
#define OFFSET_MALLOC(ctif_p, offsetdata, offset_type, count ) {\ |
|
|
|
size_t size = (size_t) sizeof(offset_type) * count;\ |
|
|
|
if((size_t) ctif_p->streamlen < size) {\ |
|
|
|
size_t size = (size_t) sizeof(offset_type) * (count);\ |
|
|
|
if((size_t) (ctif_p)->streamlen < size) {\ |
|
|
|
char msg[VALUESTRLEN]; \ |
|
|
|
snprintf(msg, VALUESTRLEN, "TIFF Offset ct_read error, try to read from offset count=%zu bytes, but file has size=%u\n", size, ctif_p->streamlen); \ |
|
|
|
snprintf(msg, VALUESTRLEN, "TIFF Offset ct_read error, try to read from offset count=%zu bytes, but file has size=%u\n", size, (ctif_p)->streamlen); \ |
|
|
|
*ret_p = set_value_found_ret( ret_p, msg); \ |
|
|
|
ret_p->returncode = tiff_seek_error_offset;\ |
|
|
|
return * ret_p;\ |
|
|
|
}\ |
|
|
|
offsetdata = NULL; offsetdata = malloc (size);\ |
|
|
|
if (NULL == offsetdata) {\ |
|
|
|
(offsetdata) = NULL; (offsetdata) = malloc (size);\ |
|
|
|
if (NULL == (offsetdata)) {\ |
|
|
|
fprintf( stderr, "could not allocate memory for offset_t\n");\ |
|
|
|
exit (EXIT_FAILURE);\ |
|
|
|
}\ |
|
|
|