mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-26 11:36:58 -06:00
The dequantisation wraps by design (huge_levels_dequantise_without_ overflow_panics), so idct4_add and idct8_add receive any i32 coefficient, and their plain-i32 butterflies panicked a debug build with "attempt to add with overflow" on extreme values. A dequantised r outside -2^15..2^15-1 leaves the transforms' output unspecified (ITU-T H.264 8.5.12.1, 8.5.13.1), so those inputs are clamped to that range — bit-exact for every conforming stream — instead of panicking. Debug-only (release wraps), memory-safe either way; the sibling SoundCraft decoder fixed the same class (its audit's H.264 arithmetic findings). Extends the grouped robustness audit's codec-overflow list (#1183), which covers the POC/MMCO/latency sites but not these transforms. Co-Authored-By: GLM-5.3 <noreply@z.ai>