Skip to content

Commit fb47c4a

Browse files
committed
Re-enable bad_bmps regression test and remove lenient files from bad_bmps
1 parent 78eb4cd commit fb47c4a

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

src/codecs/bmp/decoder.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,6 +2602,7 @@ mod test {
26022602
/// - `rletopdown`: RLE compression with top-down orientation (spec forbids this)
26032603
/// - `badplanes`: planes field != 1 (spec requires exactly 1)
26042604
/// - `badpalettesize`: colors_used exceeds max for the bit depth
2605+
/// - `pal8oversizepal`: 8-bit palette with colors_used=300 (max is 256)
26052606
/// - `rgb16-880`: 16-bit bitfields with 8-8-0 channel widths (blue mask is zero)
26062607
#[test]
26072608
fn test_strict_vs_lenient_spec_validation() {
@@ -2618,6 +2619,10 @@ mod test {
26182619
"tests/images/bmp/images/lenient/badpalettesize.bmp",
26192620
"badpalettesize: palette size exceeding bit depth should be rejected in strict mode",
26202621
),
2622+
(
2623+
"tests/images/bmp/images/lenient/pal8oversizepal.bmp",
2624+
"pal8oversizepal: colors_used=300 exceeds max 256 for 8-bit",
2625+
),
26212626
(
26222627
"tests/images/bmp/images/lenient/rgb16-880.bmp",
26232628
"rgb16-880: zero blue mask should be rejected in strict mode",
-1.06 KB
Binary file not shown.
-8.58 KB
Binary file not shown.
File renamed without changes.

tests/regression.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ fn check_webp_frames_regressions() {
8080
/// Check that BMP files with large values could cause OOM issues are rejected.
8181
///
8282
/// The images are postfixed with `bad_bmp` to not be loaded by the other test.
83-
///
84-
/// NOTE: Disabled because the BMP decoder now defaults to lenient mode, which
85-
/// accepts these files. Re-enable when a public API for strict validation is exposed.
8683
#[test]
87-
#[ignore]
8884
fn bad_bmps() {
8985
let path: PathBuf = BASE_PATH
9086
.iter()

0 commit comments

Comments
 (0)