Skip to main content

DEFAULT_MAX_PACKET_BYTES

Constant DEFAULT_MAX_PACKET_BYTES 

Source
pub const DEFAULT_MAX_PACKET_BYTES: usize = _; // 1_073_741_824usize
Expand description

Default ceiling on one packet’s payload — 1 GiB.

Why this number. Deliberately ceiling-class rather than tuned: AVPacket.size is a c_int, so 2 GiB is the structural maximum and this halves it. Real packets are nowhere near — an intra-only 8K ProRes 4444 XQ frame is ~10 MB, an uncompressed v210 8K frame ~88 MB, and a whole-file attachment (the largest packet shape that exists) is bounded far below by DEFAULT_MAX_ATTACHMENT_BYTES. The job here is to refuse the forged size field, not to second-guess a codec.