this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a check to draw.c:getPalette so it does not write out of bounds past the mapping static array into whatever static happens to come after: Fixes #2611 segfault (#2619)

authored by

OvermindDL1 and committed by
GitHub
f6a3caf5 18dacc08

+6 -1
+6 -1
src/core/draw.c
··· 51 51 { 52 52 static u8 mapping[TIC_PALETTE_SIZE]; 53 53 for (s32 i = 0; i < TIC_PALETTE_SIZE; i++) mapping[i] = tic_tool_peek4(tic->ram->vram.mapping, i); 54 - for (s32 i = 0; i < count; i++) mapping[colors[i]] = TRANSPARENT_COLOR; 54 + for (s32 i = 0; i < count; i++) { 55 + if (colors[i] < TIC_PALETTE_SIZE) 56 + { 57 + mapping[colors[i]] = TRANSPARENT_COLOR; 58 + } 59 + } 55 60 return mapping; 56 61 } 57 62