LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Functions
tif_aux.c File Reference

Implement checked shared helpers and directory-default queries. More...

#include "tif_predict.h"
#include "tiffiop.h"
#include <float.h>
#include <math.h>
Include dependency graph for tif_aux.c:

Go to the source code of this file.

Functions

uint32_t _TIFFMultiply32 (TIFF *tif, uint32_t first, uint32_t second, const char *where)
 Multiply two unsigned values with an overflow check.
 
uint64_t _TIFFMultiply64 (TIFF *tif, uint64_t first, uint64_t second, const char *where)
 Multiply two unsigned values with an overflow check.
 
uint32_t _TIFFParseUInt32 (const char *str, uint32_t default_value, uint32_t max_value)
 Parse a decimal unsigned integer with a fallback value.
 
uint64_t _TIFFAdd64 (TIFF *tif, uint64_t first, uint64_t second, const char *where)
 Check and add two unsigned operands.
 
tmsize_t _TIFFMultiplySSize (TIFF *tif, tmsize_t first, tmsize_t second, const char *where)
 Check and multiply two signed-size operands.
 
tmsize_t _TIFFAddSSize (TIFF *tif, tmsize_t first, tmsize_t second, const char *where)
 Check and add two signed-size operands.
 
tmsize_t _TIFFCastUInt64ToSSize (TIFF *tif, uint64_t val, const char *module)
 Convert an unsigned 64-bit value after checking the destination range.
 
uint32_t _TIFFCastUInt64ToUInt32 (TIFF *tif, uint64_t val, const char *module)
 Convert an unsigned 64-bit value after checking the destination range.
 
uint32_t _TIFFMultiply32Ext (TIFF *tif, uint32_t first, uint32_t second, const char *where, bool *pOverflowed)
 Multiply two unsigned values with an overflow check, and record an overflow in a caller-provided flag.
 
uint64_t _TIFFAdd64Ext (TIFF *tif, uint64_t first, uint64_t second, const char *where, bool *pOverflowed)
 Check and add two unsigned operands, and record an overflow in a caller-provided flag.
 
uint32_t _TIFFCastUInt64ToUInt32Ext (TIFF *tif, uint64_t val, const char *module, bool *pOverflowed)
 Convert an unsigned 64-bit value after checking the destination range, and record a rejection in a caller-provided flag.
 
tmsize_t _TIFFComputeRowOffset (TIFF *tif, tmsize_t rowstride, uint32_t row, const char *where)
 Compute a checked byte offset for a row in a memory raster.
 
uint64_t _TIFFComputeBitOffset (TIFF *tif, uint32_t col, uint16_t spp, uint16_t bps, const char *where)
 Compute a checked packed-sample column offset in bits.
 
uint64_t _TIFFComputeRowSize64 (TIFF *tif, uint32_t width, uint16_t spp, uint16_t bps, const char *where)
 Compute a byte-rounded row size from width and sample geometry.
 
void * _TIFFCheckRealloc (TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
 Resize a checked array with an allocation-failure diagnostic.
 
void * _TIFFCheckMalloc (TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
 Allocate a checked array with an allocation-failure diagnostic.
 
static int TIFFDefaultTransferFunction (TIFF *tif, TIFFDirectory *td)
 Allocate and cache default gamma transfer tables.
 
static int TIFFDefaultRefBlackWhite (TIFF *tif, TIFFDirectory *td)
 Allocate and cache six default reference levels.
 
int TIFFVGetFieldDefaulted (TIFF *tif, uint32_t tag, va_list ap)
 Query a present tag or a supported default.
 
int TIFFGetFieldDefaulted (TIFF *tif, uint32_t tag,...)
 Query a present tag or a supported default.
 
float _TIFFClampDoubleToFloat (double val)
 Clamp a double to the finite float range before conversion.
 
uint32_t _TIFFClampDoubleToUInt32 (double val)
 Clamp and truncate a double to an unsigned 32-bit value.
 
int _TIFFSeekOK (TIFF *tif, toff_t off)
 Test whether an allowed absolute client seek reaches its target.
 

Detailed Description

Implement checked shared helpers and directory-default queries.

Definition in file tif_aux.c.