Files
HanifKoh d3992c2288 Bound Out-of-Range filament_map and physical_extruder_map Values (#17476)
* Treat a filament_map Nozzle Outside the Printer as Nozzle 1

A filament_map entry of 0, a negative number or a number above the
nozzle count made Extruder::extruder_id() wrap or run past the end, and
print_machine_envelope then took the std::max over the per-extruder
machine limits out of bounds on a flavour that emits them.

Print::apply now treats an entry outside [1, nozzle count] as nozzle 1,
before the variant expansion and the config snapshot, and logs it once.
After the clamp the slicing engine only sees in-range values. It works
on this print's copy of the config; readers of the plate or project
config are not changed, and in-range maps are left alone.

* Skip a physical_extruder_map Entry Outside the Per-Nozzle Table on Export

The first-filament table built for the start G-code is sized by the
nozzle count, and the export wrote it at the index named by
physical_extruder_map. An entry outside that range corrupted the heap,
and a negative one aborted or hung the export.

The value is a firmware tool number that is also emitted elsewhere, so
it is left as it is; only the write into the table is bounded.

* Treat a filament_map Nozzle Outside the Printer as Nozzle 1 in the CLI

With --filament-map-mode Manual on a multi-nozzle profile, the CLI
indexed the per-nozzle unprintable-filament sets, and shifted the
per-filament printable status, with the raw filament_map value. A value
of 0, a negative number or one above the nozzle count read out of bounds
and crashed before the print was configured.

The checks now use a local copy of the map in which an entry outside
[1, nozzle count] is nozzle 1, the same policy Print::apply applies.
In-range maps are unchanged.
2026-11-18 14:04:32 +08:00
..
2026-11-12 10:38:03 -03:00
2026-10-07 19:31:24 +08:00