forked from 1b-agent/opencadstudio-upstream
fix: trust the probe for over-budget images; TIFF allowance
Review of the image wave (with empirical reproduction against the
vendored image 0.25) found the budget contract did not hold across
formats: the decoder's Limits reserve checks NATIVE bytes-per-pixel,
so a grayscale/RGB JPEG/PNG/BMP over the RGBA budget decoded anyway
and into_rgba8() then ballooned to up to 4x it — the tab death the
budgets exist to prevent. The probed dimensions already prove an
OverBudget image cannot fit, so it is now refused without decoding,
removing all dependence on per-decoder limit fidelity.
Conversely, image's TIFF codec stacks ~3x scratch buffers on top of
the reserve, so an in-budget TIFF (the flagship GIS scenario) was
refused with a self-contradictory note ('400 MB, over the 512 MB
limit'); the decoder allowance for TIFF is now 3x while tier math
stays on the real budget.
Also: the refusal message saturates instead of overflowing on crafted
headers, the image pick only matches the refusal note naming ITS file
(peek, not drain — other references' notes survive for their own
drains), and the Georgian Supplement range ends at U+2D2F (U+2D30.. is
Tifinagh, which ships no font).
(cherry picked from commit 58d3789bcf)
Ported onto main (#1717 review): the build-web.sh wrapper and its
pages/README/Trunk wiring stay out — it works around a local Windows
trunk dist lock; the Linux Pages build is unaffected.
This commit is contained in:
1 parent
93e97bdf18
commit
a10d9c6f89
4 files changed
+44
-10
No files matched your search
@@ -253,7 +253,7 @@ pub fn script_of(ch: char) -> Option<Script> {
|
||||
0x0E80..=0x0EFF => Script::Lao,
|
||||
// Georgian: Asomtavruli/Nuskhuri, Mtavruli capitals, and the legacy
|
||||
// Supplement (khutsuri round mkhedruli).
|
||||
0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D5F => Script::Georgian,
|
||||
0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D2F => Script::Georgian,
|
||||
// Hangul → always Korean; kana → always Japanese.
|
||||
0x1100..=0x11FF | 0x3130..=0x318F | 0xAC00..=0xD7A3 => Script::Korean,
|
||||
0x3040..=0x30FF | 0x31F0..=0x31FF => Script::Japanese,
|
||||
|
||||
Reference in new issue
Block a user