|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Manage raw caches, codec progress, strile appends, and postdecode conversion. More...
Macros | |
| #define | INITIAL_THRESHOLD (1024 * 1024) |
| Start progressive raw-buffer reads at one MiB. | |
| #define | THRESHOLD_MULTIPLIER 10 |
| Grow raw-buffer read allocation stages by a factor of ten. | |
| #define | MAX_THRESHOLD |
| Set the allocation-growth cutoff to 1000 MiB. | |
| #define | TIFF_INT64_MAX ((((int64_t)0x7FFFFFFF) << 32) | 0xFFFFFFFF) |
| Bound accepted raw strile byte counts to INT64_MAX. | |
| #define | NOSTRIP ((uint32_t)(-1)) /* undefined state */ |
| Local repeat of the NOSTRIP sentinel defined in tif_dir.h. | |
| #define | WRITECHECKSTRIPS(tif, module) (((tif)->tif_flags & TIFF_BEENWRITING) || TIFFWriteCheck((tif), 0, module)) |
| Reuse write preparation or check strip organisation. | |
| #define | WRITECHECKTILES(tif, module) (((tif)->tif_flags & TIFF_BEENWRITING) || TIFFWriteCheck((tif), 1, module)) |
| Reuse write preparation or check tile organisation. | |
| #define | BUFFERCHECK(tif) |
| Reuse an output buffer or allocate default encoding storage. | |
| #define | isUnspecified(tif, f) (TIFFFieldSet(tif, f) && (tif)->tif_dir.td_imagelength == 0) |
| Test the zero-image-length provisional strile case. | |
Typedefs | |
| typedef void(* | TIFFVoidMethod) (TIFF *tif) |
| Run a codec close or cleanup operation. | |
| typedef int(* | TIFFBoolMethod) (TIFF *tif) |
| Run a codec setup or completion operation. | |
| typedef int(* | TIFFPreMethod) (TIFF *tif, uint16_t sample) |
| Prepare a codec for one sample plane. | |
| typedef int(* | TIFFCodeMethod) (TIFF *tif, uint8_t *buf, tmsize_t size, uint16_t sample) |
| Encode or decode a requested image-data extent. | |
| typedef int(* | TIFFSeekMethod) (TIFF *tif, uint32_t nrows) |
| Advance codec decoding or encoding by a row count. | |
| typedef void(* | TIFFPostMethod) (TIFF *tif, uint8_t *buf, tmsize_t size) |
| Transform image bytes in place after decoding or before encoding. | |
| typedef uint64_t(* | TIFFGetMaxCompressionRatioMethod) (TIFF *tif) |
| Return the codec allocation-sanity compression-ratio heuristic. | |
Functions | |
| static int | TIFFReadAndRealloc (TIFF *tif, tmsize_t size, tmsize_t rawdata_offset, int is_strip, uint32_t strip_or_tile, const char *module) |
| Grow and fill the raw buffer from the current client position. | |
| static int | TIFFFillStripPartial (TIFF *tif, int strip, tmsize_t read_ahead, int restart) |
| Refill a partial raw strip while retaining unconsumed bytes. | |
| static int | TIFFSeek (TIFF *tif, uint32_t row, uint16_t sample) |
| Position strip decoding at a requested scanline. | |
| static tmsize_t | TIFFReadEncodedStripGetStripSize (TIFF *tif, uint32_t strip, uint16_t *pplane) |
| Validate a strip and compute its effective decoded extent. | |
| static tmsize_t | TIFFReadRawStrip1 (TIFF *tif, uint32_t strip, void *buf, tmsize_t size, const char *module) |
| Read an exact raw-strip byte extent into caller storage. | |
| static tmsize_t | TIFFReadRawStripOrTile2 (TIFF *tif, uint32_t strip_or_tile, int is_strip, tmsize_t size, const char *module) |
| Seek to a strile and read bytes into the expandable raw cache. | |
| static TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW uint64_t | NoSanitizeSubUInt64 (uint64_t a, uint64_t b) |
| Subtract unsigned offsets with intentional modular arithmetic. | |
| int | TIFFFillStrip (TIFF *tif, uint32_t strip) |
| Load raw strip bytes and initialise codec decoding. | |
| static tmsize_t | TIFFReadRawTile1 (TIFF *tif, uint32_t tile, void *buf, tmsize_t size, const char *module) |
| Read an exact raw-tile byte extent into caller storage. | |
| int | TIFFFillTile (TIFF *tif, uint32_t tile) |
| Load raw tile bytes and initialise codec decoding. | |
| static int | TIFFStartStrip (TIFF *tif, uint32_t strip) |
| Prepare the codec and raw cursor for strip decoding. | |
| static int | TIFFStartTile (TIFF *tif, uint32_t tile) |
| Prepare the codec and raw cursor for tile decoding. | |
| static int | TIFFCheckRead (TIFF *tif, int tiles) |
| Check readable mode and expected image organisation. | |
| static int | _TIFFReserveLargeEnoughWriteBuffer (TIFF *tif, uint32_t strip_or_tile) |
| Reserve raw output capacity for a possible strile rewrite. | |
| static int | TIFFGrowStrips (TIFF *tif, uint32_t delta, const char *module) |
| Grow contiguous strip offset/count arrays by a requested delta. | |
| static int | TIFFAppendToStrip (TIFF *tif, uint32_t strip, uint8_t *data, tmsize_t cc) |
| Append stored bytes or relocate a growing overwritten strile. | |
| void | _TIFFNoPostDecode (TIFF *tif, uint8_t *buf, tmsize_t cc) |
| Leave decoded bytes unchanged. | |
| void | _TIFFSwab16BitData (TIFF *tif, uint8_t *buf, tmsize_t cc) |
| Swap each 2-byte sample in place. | |
| void | _TIFFSwab24BitData (TIFF *tif, uint8_t *buf, tmsize_t cc) |
| Swap each 3-byte sample in place. | |
| void | _TIFFSwab32BitData (TIFF *tif, uint8_t *buf, tmsize_t cc) |
| Swap each 4-byte sample in place. | |
| void | _TIFFSwab64BitData (TIFF *tif, uint8_t *buf, tmsize_t cc) |
| Swap each 8-byte sample in place. | |
| int | _TIFFCheckPostDecodeLength (TIFF *tif, TIFFPostMethod tif_postdecode, tmsize_t cc, const char *modulename) |
| Check the byte count for a byte-swapping postdecode method. | |
| int | TIFFFlushData1 (TIFF *tif) |
| Append buffered encoded bytes without invoking postencode recursively. | |
| tmsize_t | _TIFFReadEncodedStripAndAllocBuffer (TIFF *tif, uint32_t strip, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read) |
| Decode after deferred allocation of caller-owned output storage. | |
| tmsize_t | _TIFFReadEncodedTileAndAllocBuffer (TIFF *tif, uint32_t tile, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read) |
| Decode after deferred allocation of caller-owned output storage. | |
| tmsize_t | _TIFFReadTileAndAllocBuffer (TIFF *tif, void **buf, tmsize_t bufsizetoalloc, uint32_t x, uint32_t y, uint32_t z, uint16_t s) |
| Decode after deferred allocation of caller-owned output storage. | |
Manage raw caches, codec progress, strile appends, and postdecode conversion.
| #define BUFFERCHECK | ( | tif | ) |
Reuse an output buffer or allocate default encoding storage.
Short-circuits when TIFF_BUFFERSETUP is set and tif_rawdata is non-NULL; otherwise calls TIFFWriteBufferSetup() with a NULL buffer and default size, which allocates a handle-owned buffer. tif is evaluated up to three times.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
Definition at line 91 of file tif_write.c.
| #define INITIAL_THRESHOLD (1024 * 1024) |
Start progressive raw-buffer reads at one MiB.
Size in bytes of the first chunk TIFFReadAndRealloc() reads on 64-bit hosts when the raw buffer must grow, so a truncated file does not force one large allocation up front.
Definition at line 56 of file tif_read.c.
| #define isUnspecified | ( | tif, | |
| f | |||
| ) | (TIFFFieldSet(tif, f) && (tif)->tif_dir.td_imagelength == 0) |
Test the zero-image-length provisional strile case.
Pure test with no side effects; it reads the presence bitmap and ImageLength only.
| [in] | tif | Live handle expression, evaluated twice. |
| [in] | f | Valid presence-bit index, evaluated twice (by TIFFFieldSet()). |
Definition at line 726 of file tif_write.c.
| #define MAX_THRESHOLD |
Set the allocation-growth cutoff to 1000 MiB.
Once the chunk size reaches this value, TIFFReadAndRealloc() reads the whole remaining request at once; it is not a maximum read size.
Definition at line 72 of file tif_read.c.
| #define NOSTRIP ((uint32_t)(-1)) /* undefined state */ |
Local repeat of the NOSTRIP sentinel defined in tif_dir.h.
Definition at line 44 of file tif_write.c.
| #define THRESHOLD_MULTIPLIER 10 |
Grow raw-buffer read allocation stages by a factor of ten.
Each chunk TIFFReadAndRealloc() reads is ten times the previous one (1, 10, 100 MiB).
Definition at line 64 of file tif_read.c.
| #define TIFF_INT64_MAX ((((int64_t)0x7FFFFFFF) << 32) | 0xFFFFFFFF) |
Bound accepted raw strile byte counts to INT64_MAX.
Expands to INT64_MAX; TIFFFillStrip() and TIFFFillTile() reject strile byte counts beyond the signed 64-bit range.
Definition at line 83 of file tif_read.c.
| #define WRITECHECKSTRIPS | ( | tif, | |
| module | |||
| ) | (((tif)->tif_flags & TIFF_BEENWRITING) || TIFFWriteCheck((tif), 0, module)) |
Reuse write preparation or check strip organisation.
Short-circuits when TIFF_BEENWRITING is already set, so the organisation is not checked again; otherwise calls TIFFWriteCheck() with tiles = 0, which can allocate and change handle state. tif is evaluated up to twice.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | module | Diagnostic context evaluated only when preparation runs. |
Definition at line 60 of file tif_write.c.
| #define WRITECHECKTILES | ( | tif, | |
| module | |||
| ) | (((tif)->tif_flags & TIFF_BEENWRITING) || TIFFWriteCheck((tif), 1, module)) |
Reuse write preparation or check tile organisation.
Short-circuits when TIFF_BEENWRITING is already set, so the organisation is not checked again; otherwise calls TIFFWriteCheck() with tiles = 1, which can allocate and change handle state. tif is evaluated up to twice.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | module | Diagnostic context evaluated only when preparation runs. |
Definition at line 76 of file tif_write.c.
| typedef int(* TIFFBoolMethod) (TIFF *tif) |
Run a codec setup or completion operation.
Used for fixuptags/setupdecode/setupencode/postencode. May allocate state or flush encoded bytes according to its installed role; failure need not undo changes. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
Encode or decode a requested image-data extent.
Direction is selected by the installed encoder/decoder slot. Decoders write caller output; encoders read input that postprocessing/codec paths may mutate. Implementations must respect the supplied nonnegative extent and their format preconditions. No ownership transfer, capacity discovery, or rollback is supplied by the pointer type. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in,out] | buf | Borrowed readable/writable image buffer for the installed method role. |
| [in] | size | Nonnegative valid byte extent. |
| [in] | sample | Selected sample plane. |
| typedef uint64_t(* TIFFGetMaxCompressionRatioMethod) (TIFF *tif) |
Return the codec allocation-sanity compression-ratio heuristic.
Used for selected large-allocation checks, not a guaranteed codec expansion/capacity bound. No returned ownership; method code and any state must remain live while installed/in flight. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
Transform image bytes in place after decoding or before encoding.
Typically swaps sample byte order. Requires writable aligned storage and format-specific whole-sample multiples; no independent failure/status channel or ownership transfer. No dispatcher automatically restores source bytes. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in,out] | buf | Borrowed writable image bytes. |
| [in] | size | Nonnegative byte extent satisfying method-specific alignment/multiple rules. |
| typedef int(* TIFFPreMethod) (TIFF *tif, uint16_t sample) |
Prepare a codec for one sample plane.
Called after raw input/output state is selected. Borrows the handle; plane-specific allocations/state remain codec-owned until its cleanup. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | sample | Selected sample plane. |
| typedef int(* TIFFSeekMethod) (TIFF *tif, uint32_t nrows) |
Advance codec decoding or encoding by a row count.
Updates codec/raw state without transferring ownership. Unsupported skips must return zero; a failed skip need not preserve the starting state. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | nrows | Number of rows to skip forward. |
| typedef void(* TIFFVoidMethod) (TIFF *tif) |
Run a codec close or cleanup operation.
May release codec-owned state, restore method chains, and change the handle; client resources remain governed by lifecycle ownership. No status result is available; implementations must report failures through diagnostics where applicable. Invoked synchronously through a borrowed method; keep code/state live for calls, serialise handle access, and avoid recursive dispatch through the same installed slot.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
|
extern |
Check the byte count for a byte-swapping postdecode method.
Recognises the 16-, 24-, 32-, and 64-bit swab methods and checks that cc is a multiple of their sample width. Other methods pass without a check. Does not invoke the method, access pixel storage, allocate, perform I/O, or transfer ownership. A mismatch reports through TIFFErrorExtR(); the caller must reject the operation before invoking postdecode. Diagnostic callbacks can have their own side effects; no errno guarantee is made.
| [in] | tif | Live handle used for error dispatch; not modified. |
| [in] | tif_postdecode | Effective postdecode method, including any adjustment for complex samples; borrowed and not invoked. |
| [in] | cc | Nonnegative byte count to be passed to postdecode. |
| [in] | modulename | Borrowed diagnostic context string, valid for the duration of the call. |
Definition at line 2260 of file tif_read.c.
References _TIFFSwab16BitData(), _TIFFSwab24BitData(), _TIFFSwab32BitData(), _TIFFSwab64BitData(), TIFF_SSIZE_FORMAT, and TIFFErrorExtR().
Referenced by _TIFFReadEncodedStripAndAllocBuffer(), _TIFFReadEncodedTileAndAllocBuffer(), TIFFReadEncodedStrip(), TIFFReadEncodedTile(), TIFFReadFromUserBuffer(), TIFFReadScanline(), TIFFWriteEncodedStrip(), TIFFWriteEncodedTile(), and TIFFWriteScanline().
Leave decoded bytes unchanged.
No-op: all arguments are ignored and no allocation, diagnostics, state, ownership, or byte changes occur.
| [in] | tif | Unused context, may be NULL. |
| [in] | buf | Ignored; not dereferenced. |
| [in] | cc | Ignored. |
Definition at line 2209 of file tif_read.c.
Referenced by _TIFFVSetField(), JPEGSetupDecode(), LogLuvSetupDecode(), PixarLogSetupDecode(), PredictorSetupDecode(), PredictorSetupEncode(), and TIFFDefaultDirectory().
|
extern |
Decode after deferred allocation of caller-owned output storage.
An existing *buf delegates to the normal decoder. A NULL slot first loads raw data and applies selected compression-ratio/size sanity checks, then allocates zeroed matching Ext storage. On success the caller owns it and must use _TIFFfreeExt(tif,...); keep the matching handle/accounting context alive. Later decode failure retains that allocation and partial output in *buf for the caller to release. The separate allocation-size and decode-size parameters are caller-established invariants, not an automatic capacity check. Tile coordinate wrapper checks coordinates before delegating. May allocate or replace handle-owned raw/strile buffers, load deferred metadata, seek/read/write client I/O, and invoke codec/tag/diagnostic callbacks. No handle or caller-buffer ownership transfers. Failure is not transactional: buffers, codec progress, indices, flags, metadata, file position, or file bytes can already have changed; disregard partial decoded output unless a codec explicitly documents otherwise. No errno, rollback, or durability guarantee. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip | Valid strip index. |
| [in,out] | buf | Non-NULL owner slot, initially NULL or a matching writable allocation; existing storage must already have enough capacity. |
| [in] | bufsizetoalloc | Positive allocation byte count at least the effective decoded output extent; the helper does not verify that relationship. |
| [in] | size_to_read | Minus one for full decoded extent, otherwise nonnegative supported output limit. |
Definition at line 769 of file tif_read.c.
References _TIFFcallocExt(), _TIFFCheckPostDecodeLength(), tiff::tif_decodestrip, tiff::tif_postdecode, tiff::tif_rawdatasize, TIFFErrorExtR(), TIFFFileName(), TIFFFillStrip(), TIFFGetMaxCompressionRatio(), TIFFReadEncodedStrip(), and TIFFReadEncodedStripGetStripSize().
Referenced by gtStripContig(), and gtStripSeparate().
|
extern |
Decode after deferred allocation of caller-owned output storage.
An existing *buf delegates to the normal decoder. A NULL slot first loads raw data and applies selected compression-ratio/size sanity checks, then allocates zeroed matching Ext storage. An uncompressed tile must have a recorded byte count equal to the tile size. On success the caller owns it and must use _TIFFfreeExt(tif,...); keep the matching handle/accounting context alive. Later decode failure retains that allocation and partial output in *buf for the caller to release. The separate allocation-size and decode-size parameters are caller-established invariants, not an automatic capacity check. Tile coordinate wrapper checks coordinates before delegating. May allocate or replace handle-owned raw/strile buffers, load deferred metadata, seek/read/write client I/O, and invoke codec/tag/diagnostic callbacks. No handle or caller-buffer ownership transfers. Failure is not transactional: buffers, codec progress, indices, flags, metadata, file position, or file bytes can already have changed; disregard partial decoded output unless a codec explicitly documents otherwise. No errno, rollback, or durability guarantee. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | tile | Valid tile index. |
| [in,out] | buf | Non-NULL owner slot, initially NULL or a matching writable allocation; existing storage must already have enough capacity. |
| [in] | bufsizetoalloc | Positive allocation byte count at least the effective decoded output extent; the helper does not verify that relationship. |
| [in] | size_to_read | Minus one for full decoded extent, otherwise nonnegative supported output limit. |
Definition at line 1373 of file tif_read.c.
References _TIFFCheckPostDecodeLength(), _TIFFmallocExt(), _TIFFmemset(), COMPRESSION_NONE, TIFFDirectory::td_tilesize, tiff::tif_decodetile, tiff::tif_dir, tiff::tif_postdecode, tiff::tif_rawdatasize, TIFFCheckRead(), TIFFErrorExtR(), TIFFFileName(), TIFFFillTile(), TIFFGetMaxCompressionRatio(), TIFFGetStrileByteCount(), and TIFFReadEncodedTile().
Referenced by _TIFFReadTileAndAllocBuffer().
|
extern |
Decode after deferred allocation of caller-owned output storage.
An existing *buf delegates to the normal decoder. A NULL slot first loads raw data and applies selected compression-ratio/size sanity checks, then allocates zeroed matching Ext storage. On success the caller owns it and must use _TIFFfreeExt(tif,...); keep the matching handle/accounting context alive. Later decode failure retains that allocation and partial output in *buf for the caller to release. The separate allocation-size and decode-size parameters are caller-established invariants, not an automatic capacity check. Tile coordinate wrapper checks coordinates before delegating. May allocate or replace handle-owned raw/strile buffers, load deferred metadata, seek/read/write client I/O, and invoke codec/tag/diagnostic callbacks. No handle or caller-buffer ownership transfers. Failure is not transactional: buffers, codec progress, indices, flags, metadata, file position, or file bytes can already have changed; disregard partial decoded output unless a codec explicitly documents otherwise. No errno, rollback, or durability guarantee. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in,out] | buf | Non-NULL owner slot, initially NULL or a matching writable allocation; existing storage must already have enough capacity. |
| [in] | bufsizetoalloc | Positive allocation byte count at least the effective decoded output extent; the helper does not verify that relationship. |
| [in] | x | Image column. |
| [in] | y | Image row. |
| [in] | z | Depth slice. |
| [in] | s | Separate sample plane. |
Definition at line 1350 of file tif_read.c.
References _TIFFComputeTileExt(), _TIFFReadEncodedTileAndAllocBuffer(), TIFFCheckRead(), and TIFFCheckTile().
Referenced by gtTileContig(), and gtTileSeparate().
|
static |
Reserve raw output capacity for a possible strile rewrite.
Requires a valid count array/index. Can replace output buffering with a rounded owned allocation larger than the previous stored count plus safety margin, even if a borrowed buffer was attached. Byte-count-plus-margin and casts rely on representable metadata; not general overflow validation. Old raw contents can be lost. The only effects are TIFFWriteBufferSetup() replacing the raw buffer and diagnostics; no client I/O. If that allocation fails, the previous raw buffer has already been released and tif_rawdata is NULL. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip_or_tile | Valid logical strile index for this operation. |
Definition at line 291 of file tif_write.c.
References NOSTRIP, tiff::tif_dir, tiff::tif_rawdatasize, TIFFErrorExtR(), TIFFroundup_64, and TIFFWriteBufferSetup().
Referenced by TIFFWriteEncodedStrip(), and TIFFWriteEncodedTile().
Swap each 2-byte sample in place.
Swaps complete samples and leaves any trailing partial sample unchanged. A byte count not divisible by 2 emits a warning through TIFFWarningExtR() in all builds, but does not prevent swapping the complete samples. Borrows/modifies bytes without allocation, I/O, or ownership transfer. It is an involution on complete samples, not general sample conversion.
| [in] | tif | Live handle used for warning dispatch; not modified. |
| [in,out] | buf | Writable storage of cc bytes with alignment suitable for uint16_t. |
| [in] | cc | Nonnegative byte count; a multiple of 2 swaps all bytes. |
Definition at line 2216 of file tif_read.c.
References TIFF_SSIZE_FORMAT, TIFFSwabArrayOfShort(), and TIFFWarningExtR().
Referenced by _TIFFCheckPostDecodeLength(), and _TIFFVSetField().
Swap each 3-byte sample in place.
Swaps complete samples and leaves any trailing partial sample unchanged. A byte count not divisible by 3 emits a warning through TIFFWarningExtR() in all builds, but does not prevent swapping the complete samples. Borrows/modifies bytes without allocation, I/O, or ownership transfer. It is an involution on complete samples, not general sample conversion.
| [in] | tif | Live handle used for warning dispatch; not modified. |
| [in,out] | buf | Writable storage of cc bytes with any alignment. |
| [in] | cc | Nonnegative byte count; a multiple of 3 swaps all bytes. |
Definition at line 2226 of file tif_read.c.
References TIFF_SSIZE_FORMAT, TIFFSwabArrayOfTriples(), and TIFFWarningExtR().
Referenced by _TIFFCheckPostDecodeLength(), and _TIFFVSetField().
Swap each 4-byte sample in place.
Swaps complete samples and leaves any trailing partial sample unchanged. A byte count not divisible by 4 emits a warning through TIFFWarningExtR() in all builds, but does not prevent swapping the complete samples. Borrows/modifies bytes without allocation, I/O, or ownership transfer. It is an involution on complete samples, not general sample conversion.
| [in] | tif | Live handle used for warning dispatch; not modified. |
| [in,out] | buf | Writable storage of cc bytes with alignment suitable for uint32_t. |
| [in] | cc | Nonnegative byte count; a multiple of 4 swaps all bytes. |
Definition at line 2236 of file tif_read.c.
References TIFF_SSIZE_FORMAT, TIFFSwabArrayOfLong(), and TIFFWarningExtR().
Referenced by _TIFFCheckPostDecodeLength(), and _TIFFVSetField().
Swap each 8-byte sample in place.
Swaps complete samples and leaves any trailing partial sample unchanged. A byte count not divisible by 8 emits a warning through TIFFWarningExtR() in all builds, but does not prevent swapping the complete samples. Borrows/modifies bytes without allocation, I/O, or ownership transfer. It is an involution on complete samples, not general sample conversion.
| [in] | tif | Live handle used for warning dispatch; not modified. |
| [in,out] | buf | Writable storage of cc bytes with alignment suitable for double. |
| [in] | cc | Nonnegative byte count; a multiple of 8 swaps all bytes. |
Definition at line 2246 of file tif_read.c.
References TIFF_SSIZE_FORMAT, TIFFSwabArrayOfDouble(), and TIFFWarningExtR().
Referenced by _TIFFCheckPostDecodeLength(), and _TIFFVSetField().
|
static |
Subtract unsigned offsets with intentional modular arithmetic.
Pure modulo-2^64 subtraction, without overflow rejection, diagnostics, allocation, state, or ownership effects; unsigned-overflow instrumentation is disabled for this helper.
| [in] | a | Unsigned minuend. |
| [in] | b | Unsigned subtrahend. |
Definition at line 1027 of file tif_read.c.
Referenced by TIFFFillStrip().
Append stored bytes or relocate a growing overwritten strile.
Validates current arrays/index, chooses existing reusable extent or EOF, resets counts when starting a write, and moves previously appended bytes to EOF if they outgrow a reused extent. Temporary copying storage is freed on ordinary exits. Checks classic-file wrap and reports I/O/allocation failures, but EOF seeks/metadata additions are not all checked. May modify earlier bytes and array offsets/counts before failure; no overlap proof, rollback, IFD persistence, or durability guarantee. Seeks, reads and writes through the client procedures and dispatches diagnostics; does not touch the raw buffer. No handle or caller-buffer ownership transfers. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip | Zero-based strip or tile index; NOSTRIP and values not below td_nstrips are diagnosed and rejected. |
| [in] | data | Borrowed readable stored bytes; no alias with buffers that append/copy may replace. |
| [in] | cc | Nonnegative byte extent with representable file-offset/count additions. |
Definition at line 1021 of file tif_write.c.
References _TIFFfreeExt(), _TIFFmallocExt(), NOSTRIP, ReadOK, SeekOK, TIFFDirectory::td_row, tiff::tif_curoff, tiff::tif_dir, tiff::tif_flags, tiff::tif_lastvalidoff, TIFF_BIGTIFF, TIFF_DIRTYSTRIP, TIFFErrorExtR(), TIFFSeekFile, and WriteOK.
Referenced by TIFFFlushData1(), TIFFWriteEncodedStrip(), TIFFWriteEncodedTile(), TIFFWriteRawStrip(), and TIFFWriteRawTile().
|
static |
Check readable mode and expected image organisation.
Checks O_WRONLY rejection and whether tiles matches isTiled(). If a scanline write is pending (TIFF_BUF4WRITE), finishes it with TIFFFlushData() before a read can resize the raw buffer the encoder still points into, then clears TIFF_BUF4WRITE and forgets the current strip and tile so the next read reloads its strile and runs predecode. Flushing can encode and write data; otherwise no allocation, pixel/codec validation, file I/O, or ownership transfer. Errors dispatch diagnostics.
| [in,out] | tif | Non-NULL live handle whose mode and organisation are read; serialise access externally. |
| [in] | tiles | Exactly zero for strips or one for tiles. |
Definition at line 2036 of file tif_read.c.
References isTiled, NOSTRIP, NOTILE, TIFFDirectory::td_curstrip, TIFFDirectory::td_curtile, tiff::tif_dir, tiff::tif_flags, tiff::tif_mode, tiff::tif_name, TIFF_BUF4WRITE, TIFFErrorExtR(), and TIFFFlushData().
Referenced by _TIFFReadEncodedTileAndAllocBuffer(), _TIFFReadTileAndAllocBuffer(), TIFFReadEncodedStripGetStripSize(), TIFFReadEncodedTile(), TIFFReadRawStrip(), TIFFReadRawTile(), TIFFReadScanline(), and TIFFReadTile().
| int TIFFFillStrip | ( | TIFF * | tif, |
| uint32_t | strip | ||
| ) |
Load raw strip bytes and initialise codec decoding.
Caller supplies valid strip metadata/index. Validates byte-count bounds, applies recovery size/ratio heuristics, uses mapped bytes when fill order allows or replaces/grows raw storage, reverses bits when needed, and calls TIFFStartStrip(). Non-raw codecs skip loading. Borrowed raw data can be detached but is not freed as owned storage. Mapping/cache/codec state can change on failure. May allocate or replace the handle-owned raw buffer, load deferred strile metadata, seek and read through the client procedures, and invoke codec and diagnostic callbacks; it never writes to the file. No handle or caller-buffer ownership transfers. Failure is not transactional: buffers, codec progress, indices, flags, or file position can already have changed. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip | Valid zero-based strip index; not range-checked here. |
Definition at line 1055 of file tif_read.c.
References _TIFFfreeExt(), isFillOrder, isMapped, NoSanitizeSubUInt64(), NOSTRIP, TIFFDirectory::td_curstrip, tiff::tif_base, tiff::tif_dir, tiff::tif_flags, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_rawdataoff, tiff::tif_rawdatasize, tiff::tif_size, TIFF_BUFFERMMAP, TIFF_INT64_MAX, TIFF_MYBUFFER, TIFF_NOBITREV, TIFF_NOREADRAW, TIFFErrorExtR(), TIFFGetMaxCompressionRatio(), TIFFGetStrileByteCount(), TIFFGetStrileOffset(), TIFFReadBufferSetup(), TIFFReadRawStrip1(), TIFFReadRawStripOrTile2(), TIFFReverseBits(), TIFFStartStrip(), TIFFStripSize(), and TIFFWarningExtR().
Referenced by _TIFFReadEncodedStripAndAllocBuffer(), TIFFFillStripPartial(), TIFFReadEncodedStrip(), and TIFFSeek().
Refill a partial raw strip while retaining unconsumed bytes.
Requires a representable nonnegative int strip index, non-mapped raw buffer, valid read-ahead arithmetic, and coherent cursor/loaded counts. Moves unread bytes, grows owned storage, reads the next extent, optionally reverses bits, and restarts decoding when requested. A multi-scan JPEG restart can require a whole-strip fallback. Borrowed undersized buffers fail instead of growing. May grow the handle-owned raw buffer, load deferred strile metadata, seek and read through the client procedures, and invoke codec and diagnostic callbacks; it never writes to the file. Failure is not transactional: buffers, codec progress, indices, flags, or file position can already have changed. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip | Valid zero-based strip index; the parameter is int, so the index must be representable by int. |
| [in] | read_ahead | Nonnegative desired ahead extent with representable cursor arithmetic. |
| [in] | restart | Nonzero to reset partial-strip decoding; zero to retain unread bytes. |
Definition at line 254 of file tif_read.c.
References COMPRESSION_JPEG, isFillOrder, NOSTRIP, SeekOK, TIFFDirectory::td_compression, TIFFDirectory::td_curstrip, TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_flags, tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_rawdataoff, tiff::tif_rawdatasize, TIFF_BUFFERMMAP, TIFF_MYBUFFER, TIFF_NOBITREV, TIFF_TMSIZE_T_MAX, TIFFErrorExtR(), TIFFFillStrip(), TIFFGetStrileByteCount(), TIFFGetStrileOffset(), TIFFJPEGIsFullStripRequired(), TIFFReadAndRealloc(), TIFFReverseBits(), and TIFFStartStrip().
Referenced by TIFFSeek().
| int TIFFFillTile | ( | TIFF * | tif, |
| uint32_t | tile | ||
| ) |
Load raw tile bytes and initialise codec decoding.
Caller supplies valid tile metadata/index. Validates byte-count bounds, applies recovery size/ratio heuristics, uses mapped bytes when fill order allows or replaces/grows raw storage, reverses bits when needed, and calls TIFFStartTile(). Non-raw codecs skip loading. Cache/codec state can change before failure. May allocate or replace the handle-owned raw buffer, load deferred strile metadata, seek and read through the client procedures, and invoke codec and diagnostic callbacks; it never writes to the file. No handle or caller-buffer ownership transfers. Failure is not transactional: buffers, codec progress, indices, flags, or file position can already have changed. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | tile | Valid zero-based tile index; not range-checked here. |
Definition at line 1614 of file tif_read.c.
References _TIFFfreeExt(), isFillOrder, isMapped, NOTILE, TIFFDirectory::td_curtile, tiff::tif_base, tiff::tif_dir, tiff::tif_flags, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_rawdataoff, tiff::tif_rawdatasize, tiff::tif_size, TIFF_BUFFERMMAP, TIFF_INT64_MAX, TIFF_MYBUFFER, TIFF_NOBITREV, TIFF_NOREADRAW, TIFFErrorExtR(), TIFFGetMaxCompressionRatio(), TIFFGetStrileByteCount(), TIFFGetStrileOffset(), TIFFReadBufferSetup(), TIFFReadRawStripOrTile2(), TIFFReadRawTile1(), TIFFReverseBits(), TIFFStartTile(), TIFFTileSize(), and TIFFWarningExtR().
Referenced by _TIFFReadEncodedTileAndAllocBuffer(), and TIFFReadEncodedTile().
|
extern |
Append buffered encoded bytes without invoking postencode recursively.
When rawcc is positive and BUF4WRITE set, may reverse raw-buffer bits in place and append to current strip/tile. Resets rawcc/rawcp even after append failure, so failed flush loses pending-buffer retry state. Does not write the directory, close/free the handle, or finish codec postencoding. No output ownership transfers; diagnostics/file effects follow append. No rollback.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
Definition at line 1213 of file tif_write.c.
References isFillOrder, isTiled, TIFFDirectory::td_curstrip, TIFFDirectory::td_curtile, TIFFDirectory::td_fillorder, tiff::tif_dir, tiff::tif_flags, tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdata, TIFF_BUF4WRITE, TIFF_NOBITREV, TIFFAppendToStrip(), and TIFFReverseBits().
Referenced by DumpModeEncode(), JBIGCopyEncodedData(), LERCPostEncode(), LogLuvReserve(), LZMAEncode(), LZMAPostEncode(), LZWEncode(), LZWPostEncode(), PackBitsEncode(), PixarLogEncode(), PixarLogPostEncode(), std_empty_output_buffer(), TIFFFlushData(), TIFFWriteDirectorySec(), TWebPPostEncode(), ZIPEncode(), ZIPPostEncode(), ZSTDEncode(), and ZSTDPostEncode().
|
static |
Grow contiguous strip offset/count arrays by a requested delta.
Requires contiguous layout and representable nonnegative allocation products. Reallocates arrays separately, updates each pointer immediately, zeroes new slots and marks directory dirty on success. If either realloc fails, sets td_nstrips zero but retains the latest allocated pointers; old views can already be invalidated. Does not grow image height itself. No client I/O; diagnoses allocation failure. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | delta | Number of slots to add; allocation products and new uint32_t count must be representable. |
| [in] | module | Borrowed diagnostic context string. |
Definition at line 939 of file tif_write.c.
References _TIFFmemset(), _TIFFMultiplySSize(), _TIFFreallocExt(), PLANARCONFIG_CONTIG, TIFFDirectory::td_nstrips, TIFFDirectory::td_planarconfig, TIFFDirectory::td_stripbytecount_p, TIFFDirectory::td_stripoffset_p, tiff::tif_dir, tiff::tif_flags, TIFF_BIGTIFF, TIFF_DIRTYDIRECT, and TIFFErrorExtR().
Referenced by TIFFWriteEncodedStrip(), TIFFWriteRawStrip(), and TIFFWriteScanline().
|
static |
Grow and fill the raw buffer from the current client position.
Reads from the current client position, which the caller has already set; this function does not seek. Requires nonnegative representable size/offset, and a library-owned raw buffer (TIFF_MYBUFFER) if it must grow. On 64-bit hosts the buffer grows in progressive 1/10/100 MiB read stages; the cutoff is not a maximum read size. On 32-bit hosts, requests above 1e9 bytes that are not smaller than the file size are rejected. Realloc failure frees the old raw allocation and clears capacity; short/error reads zero the remaining allocated tail but retain partial data. tif_rawcp is not updated and can point into freed storage after growth; callers must reset it. Failures report through TIFFErrorExtR(); no errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle whose raw buffer can be grown or freed; the client file position moves; serialise access externally. |
| [in] | size | Nonnegative number of bytes to read at rawdata_offset; zero reads nothing and succeeds. |
| [in] | rawdata_offset | Nonnegative raw-buffer destination byte offset with representable sums. |
| [in] | is_strip | Nonzero for strip wording in diagnostics, zero for tile wording. |
| [in] | strip_or_tile | Strile index, used only in diagnostics. |
| [in] | module | Borrowed diagnostic context string. |
Definition at line 116 of file tif_read.c.
References _TIFFfreeExt(), _TIFFreallocExt(), INITIAL_THRESHOLD, MAX_THRESHOLD, TIFFDirectory::td_col, TIFFDirectory::td_row, THRESHOLD_MULTIPLIER, tiff::tif_dir, tiff::tif_flags, tiff::tif_rawdata, tiff::tif_rawdatasize, TIFF_MYBUFFER, TIFF_SSIZE_FORMAT, TIFFErrorExtR(), TIFFGetFileSize, TIFFReadFile, and TIFFroundup_64.
Referenced by TIFFFillStripPartial(), and TIFFReadRawStripOrTile2().
|
static |
Validate a strip and compute its effective decoded extent.
Checks readable strip organisation/index and nonzero row geometry, computes truncated last-strip rows and optional plane, and calls the layout calculator. Does not load/decode pixels or acquire output storage; diagnostics can occur.
| [in] | tif | Non-NULL live handle whose mode, organisation and geometry are read; serialise access externally. |
| [in] | strip | Zero-based strip index; values not below td_nstrips are diagnosed and rejected. |
| [out] | pplane | Optional plane-number output; written once the strip index and RowsPerStrip checks pass, before the size computation, so it can be set even when -1 is returned. |
Definition at line 662 of file tif_read.c.
References tiff::tif_dir, TIFFCheckRead(), TIFFErrorExtR(), TIFFhowmany_32_maxuint_compat, and TIFFVStripSize().
Referenced by _TIFFReadEncodedStripAndAllocBuffer(), and TIFFReadEncodedStrip().
|
static |
Read an exact raw-strip byte extent into caller storage.
Caller validates organisation/index/raw access and positive destination extent. Copies mapped bytes after range checks or seeks/reads exact client bytes. Does not bit-reverse/decode/own the destination; partial stream reads can modify it before failure. Loading the strile offset may read deferred metadata. Allocates nothing, never writes to the file, and leaves the raw buffer and codec state alone; a failed stream read can leave the file position moved. Failures report through TIFFErrorExtR(); no errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle; deferred strile offsets can be loaded and the client file position moves; serialise access externally. |
| [in] | strip | Valid zero-based strip index; not range-checked here. |
| [out] | buf | Borrowed writable caller buffer large enough for size bytes. |
| [in] | size | Positive number of raw bytes to copy into buf. |
| [in] | module | Borrowed diagnostic context string. |
Definition at line 853 of file tif_read.c.
References _TIFFmemcpy(), isMapped, SeekOK, TIFFDirectory::td_row, tiff::tif_base, tiff::tif_dir, tiff::tif_flags, tiff::tif_size, TIFF_NOREADRAW, TIFF_SSIZE_FORMAT, TIFF_TMSIZE_T_MAX, TIFFErrorExtR(), TIFFGetStrileOffset(), and TIFFReadFile.
Referenced by TIFFFillStrip(), TIFFReadEncodedStrip(), and TIFFReadRawStrip().
|
static |
Seek to a strile and read bytes into the expandable raw cache.
Requires non-mapped raw access and valid metadata/index. Delegates allocation/read to TIFFReadAndRealloc(); old owned cache can be lost on failure. Moves file position and reports contextual strip/tile failures. Loading the strile offset may read deferred metadata. Never writes to the file and invokes no codec callbacks; tif_rawcp is not updated. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle whose raw buffer can be grown or freed, deferred strile offsets loaded and file position moved; serialise access externally. |
| [in] | strip_or_tile | Valid strile index whose offset is sought to; not range-checked here. |
| [in] | is_strip | Nonzero for strip wording in diagnostics, zero for tile wording. |
| [in] | size | Nonnegative number of raw bytes to read into the raw buffer from its start. |
| [in] | module | Borrowed diagnostic context string. |
Definition at line 938 of file tif_read.c.
References isMapped, SeekOK, TIFFDirectory::td_col, TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_flags, TIFF_NOREADRAW, TIFFErrorExtR(), TIFFGetStrileOffset(), and TIFFReadAndRealloc().
Referenced by TIFFFillStrip(), and TIFFFillTile().
|
static |
Read an exact raw-tile byte extent into caller storage.
Caller validates organisation/index/raw access and positive destination extent. Copies mapped bytes after range checks or seeks/reads exact client bytes. Does not bit-reverse/decode/own the destination; partial stream reads can modify it before failure. Loading the strile offset may read deferred metadata. Allocates nothing, never writes to the file, and leaves the raw buffer and codec state alone; a failed stream read can leave the file position moved. Failures report through TIFFErrorExtR(); no errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle; deferred strile offsets can be loaded and the client file position moves; serialise access externally. |
| [in] | tile | Valid zero-based tile index; not range-checked here. |
| [out] | buf | Borrowed writable caller buffer large enough for size bytes. |
| [in] | size | Positive number of raw bytes to copy into buf. |
| [in] | module | Borrowed diagnostic context string. |
Definition at line 1483 of file tif_read.c.
References _TIFFmemcpy(), isMapped, SeekOK, TIFFDirectory::td_col, TIFFDirectory::td_row, tiff::tif_base, tiff::tif_dir, tiff::tif_flags, tiff::tif_size, TIFF_NOREADRAW, TIFF_SSIZE_FORMAT, TIFF_TMSIZE_T_MAX, TIFFErrorExtR(), TIFFGetStrileOffset(), and TIFFReadFile.
Referenced by TIFFFillTile(), TIFFReadEncodedTile(), and TIFFReadRawTile().
|
static |
Position strip decoding at a requested scanline.
Validates row, RowsPerStrip and separate sample, computes strip, fills whole/partial raw input, restarts for backward access, and uses the codec seek callback to skip forward. Backward/random access may be unsupported by the codec. May grow or replace the handle-owned raw buffer, load deferred strile metadata, seek and read through the client procedures, and invoke codec and diagnostic callbacks; it never writes to the file. Failure is not transactional: buffers, codec progress, indices, flags, or file position can already have changed. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | row | Requested row; values not below ImageLength are diagnosed and rejected. |
| [in] | sample | Sample plane for separate planar images (range-checked against SamplesPerPixel); ignored where contiguous. |
Definition at line 439 of file tif_read.c.
References _TIFFAdd64(), _TIFFCastUInt64ToUInt32(), _TIFFMultiply64(), COMPRESSION_JBIG, COMPRESSION_LERC, isMapped, PLANARCONFIG_SEPARATE, TIFFDirectory::td_compression, TIFFDirectory::td_curstrip, TIFFDirectory::td_imagelength, TIFFDirectory::td_planarconfig, TIFFDirectory::td_row, TIFFDirectory::td_rowsperstrip, TIFFDirectory::td_samplesperpixel, TIFFDirectory::td_scanlinesize, TIFFDirectory::td_stripsperimage, tiff::tif_dir, tiff::tif_name, tiff::tif_rawcp, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_rawdataoff, tiff::tif_seek, TIFF_TMSIZE_T_MAX, TIFFErrorExtR(), TIFFFillStrip(), TIFFFillStripPartial(), TIFFGetStrileByteCount(), and TIFFStartStrip().
Referenced by TIFFReadScanline().
|
static |
Prepare the codec and raw cursor for strip decoding.
Runs setupdecode once, validates strips-per-plane, sets current strip/row and raw input state, then calls predecode for its plane. Predecode failure invalidates current strip; other setup/state changes survive. Reads no strip payload and allocates no raw buffer itself; when no data is loaded, the raw byte count comes from TIFFGetStrileByteCount(), which may load deferred metadata. The setupdecode and predecode callbacks can allocate codec state, and some codecs (OJPEG) seek and read the file there. No errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | strip | Valid zero-based strip index; not range-checked here. |
Definition at line 1886 of file tif_read.c.
References NOSTRIP, TIFFDirectory::td_curstrip, TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_flags, tiff::tif_predecode, tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_setupdecode, TIFF_CODERSETUP, TIFF_NOREADRAW, TIFFErrorExtR(), TIFFGetStrileByteCount(), and TIFFSafeModMul32.
Referenced by TIFFFillStrip(), TIFFFillStripPartial(), TIFFReadFromUserBuffer(), and TIFFSeek().
|
static |
Prepare the codec and raw cursor for tile decoding.
Runs setupdecode once, sets current tile and row/column caches using tile geometry, selects raw input, and invokes predecode. Requires nonzero strips-per-plane and valid index from the caller. Unlike strip start, predecode failure does not explicitly invalidate the current tile. Reads no tile payload and allocates no raw buffer itself; when no data is loaded, the raw byte count comes from TIFFGetStrileByteCount(), which may load deferred metadata. The setupdecode and predecode callbacks can allocate codec state, and some codecs (OJPEG) seek and read the file there. State is not rolled back; no errno contract. See Image transfers and buffers.
| [in,out] | tif | Non-NULL live handle with matching current geometry and codec methods; serialise access externally. |
| [in] | tile | Valid zero-based tile index; not range-checked here. |
Definition at line 1959 of file tif_read.c.
References TIFFDirectory::td_col, TIFFDirectory::td_curtile, TIFFDirectory::td_row, tiff::tif_dir, tiff::tif_flags, tiff::tif_predecode, tiff::tif_rawcc, tiff::tif_rawcp, tiff::tif_rawdata, tiff::tif_rawdataloaded, tiff::tif_setupdecode, TIFF_CODERSETUP, TIFF_NOREADRAW, TIFFErrorExtR(), TIFFGetStrileByteCount(), TIFFhowmany_32, and TIFFSafeModMul32.
Referenced by TIFFFillTile(), and TIFFReadFromUserBuffer().