mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-27 00:55:15 +00:00
The "Iterate through the component's color sets, and transfer them" logic shifted `from.begin()`, which would make subsequent `std::advance` calls go past `_assigned.end()` and cause UB. This rewrite uses absolute numeric indexes into `_assigned` to avoid that potential problem. I haven't been able to craft a test case that actually *reaches* that piece of logic, and I suspect that it's unreachable given how we sort and process color sets before decanting, but cannot prove that; so it stays in. (Maybe if we added 4bpp 16-colors-per-palette support, it would become reachable?)