gbdev/rgbds

RGBGFX does not validate tile indices

Closed this issue · 1 comments

% rgbgfx -r 40 -t bg_currents.bin -b 1 -o tileset.2bpp map.png
/usr/include/c++/14.1.1/bits/stl_vector.h:1149: constexpr std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = unsigned char; _Alloc = default_init_allocator<unsigned char, std::allocator<unsigned char> >; const_reference = const unsigned char&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
zsh: IOT instruction (core dumped)  rgbgfx -r 40 -t bg_currents.bin -b 1 -o tileset.2bpp /map.png

assets.zip

The tilemap references tile IDs that aren't present in the tile data (turns out they're loaded separately), but this shouldn't cause a crash.

Note: map.png is the same one from #1427.