Struct gif::MemoryLimit
source · pub struct MemoryLimit(pub u32);
Expand description
StreamingDecoder configuration parameters
Memory limit in bytes. MemoryLimit(0)
means
that there is no memory limit set.
Tuple Fields§
§0: u32
Implementations§
source§impl MemoryLimit
impl MemoryLimit
sourcepub const NONE: MemoryLimit = _
pub const NONE: MemoryLimit = _
Enforce no memory limit.
If you intend to process images from unknown origins this is a potentially dangerous constant to use, as your program could be vulnerable to decompression bombs. That is, malicious images crafted specifically to require an enormous amount of memory to process while having a disproportionately small file size.
The risks for modern machines are a bit smaller as the dimensions of each frame can not
exceed u32::MAX
(~4Gb) but this is still a significant amount of memory.
Trait Implementations§
source§impl Clone for MemoryLimit
impl Clone for MemoryLimit
source§fn clone(&self) -> MemoryLimit
fn clone(&self) -> MemoryLimit
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more