Guard tracks decompression progress and enforces limits
Instance methods
add_compressed(bytes :
Int) :
Nil Record compressed data read
Sourceadd_decompressed(bytes :
Int) :
Nil Record decompressed data produced
Sourcecheck_limits
Check if limits are exceeded and raise if so
Sourcevalidate_expected_size(width :
Int32, height :
Int32, bytes_per_pixel :
Int32) :
Nil Validate expected decompressed size against limits
Call this when you know the expected size before decompression
Source