Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const MaxBoxNestingDepth + const MaxCodeBlockDim + const MaxCodeBlockSize + const MaxComponents + const MaxDecompositionLevels + const MaxImageArea + const MaxImageHeight + const MaxImageWidth + const MaxIterations + const MaxMarkerSegments + const MaxPrecinctSize + const MaxQualityLayers + const MaxResolutionLevels + const MaxSegmentLength + const MaxTileHeight + const MaxTileWidth + const MaxTiles + var ErrCodeBlockTooLarge = errors.New("code block size exceeds maximum") + var ErrImageTooLarge = errors.New("image dimensions exceed maximum allowed") + var ErrIntegerOverflow = errors.New("integer overflow detected") + var ErrInvalidBitDepth = errors.New("invalid bit depth") + var ErrInvalidDimensions = errors.New("invalid dimensions (zero or negative)") + var ErrNestingTooDeep = errors.New("box nesting depth exceeds maximum") + var ErrPrecinctTooLarge = errors.New("precinct size exceeds maximum") + var ErrSegmentTooLarge = errors.New("segment length exceeds maximum") + var ErrTileTooLarge = errors.New("tile dimensions exceed maximum") + var ErrTooManyComponents = errors.New("number of components exceeds maximum") + var ErrTooManyDecompLevels = errors.New("decomposition levels exceed maximum") + var ErrTooManyLayers = errors.New("number of quality layers exceeds maximum") + var ErrTooManyTiles = errors.New("number of tiles exceeds maximum") + func SafeAdd(a, b int) (int, bool) + func SafeMultiply(a, b int) (int, bool) + func SafeSubtract(a, b int) (int, bool) + func ValidateCOD(decompositionLevels, codeBlockWidth, codeBlockHeight int) error + func ValidateSIZ(width, height, tileWidth, tileHeight, xOffset, yOffset, components int) error + type Validator struct + func NewValidator() *Validator + func (v *Validator) CheckIteration() error + func (v *Validator) CountSegment() error + func (v *Validator) EnterBox() error + func (v *Validator) ExitBox() + func (v *Validator) Reset() + func (v *Validator) ResetIteration() + func (v *Validator) SetMaxMemory(max uint64) + func (v *Validator) TrackPixels(width, height, components int) error + func (v *Validator) ValidateAllocation(size uint64) error + func (v *Validator) ValidateBitDepth(depth int) error + func (v *Validator) ValidateCodeBlockSize(width, height int) error + func (v *Validator) ValidateDecompositionLevels(levels int) error + func (v *Validator) ValidateImageSize(width, height int) error + func (v *Validator) ValidateNumComponents(n int) error + func (v *Validator) ValidateNumLayers(layers int) error + func (v *Validator) ValidateNumTiles(n int) error + func (v *Validator) ValidatePrecinctSize(width, height int) error + func (v *Validator) ValidateSegmentLength(length int) error + func (v *Validator) ValidateTileSize(width, height int) error