Skip to main content

DEFAULT_MAX_IMAGE_INPUT_BYTES

Constant DEFAULT_MAX_IMAGE_INPUT_BYTES 

Source
pub const DEFAULT_MAX_IMAGE_INPUT_BYTES: usize = DEFAULT_MAX_ATTACHMENT_BYTES; // 67_108_864usize
Expand description

Default ceiling on the compressed bytes one image decode may be handed — 64 MiB, the attachment family.

Why the attachment family and not the packet one. What crate::FfmpegImageDecoder decodes is an attachment: a whole file a container handed over eagerly. When it arrives through the demuxer it has already been charged against DEFAULT_MAX_ATTACHMENT_BYTES, and this seat is what keeps the same ceiling in force when a caller builds the packet itself — the one road that skips the demux tier entirely. A 1 GiB packet ceiling here would mean the direct road was a gigabyte more permissive than the demuxed one for the same bytes.