MEGA65 / mega65-tools

Tools and Utilities for the MEGA65 Retro Computers
GNU General Public License v3.0
28 stars 31 forks source link

m65: screenshot sometimes can fail and segfault #142

Open lydon42 opened 1 year ago

lydon42 commented 1 year ago

This is probably because of errors in the serial transmission of the memory blocks. This normally just produces glitches in the rendered image or ascii art. But the colour and character lookup helpers all have no bound checks, so it might be that some wrong value can make a lookup go out of bounds (for example out of the palette array), and therefor produce a segfault.

Quick solution will be do add bound checks to all lookup helpers in screenshot.c

Better solution will be to make serial memory dump so good that no wrong data is received.