Skip to content

Commit 402871e

Browse files
committed
Ensure CRT_colorScheme is valid
1 parent 839fc19 commit 402871e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

CRT.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,10 @@ void CRT_enableDelay(void) {
13271327
}
13281328

13291329
void CRT_setColors(int colorScheme) {
1330+
if (colorScheme >= LAST_COLORSCHEME || colorScheme < 0) {
1331+
colorScheme = COLORSCHEME_DEFAULT;
1332+
}
1333+
13301334
CRT_colorScheme = colorScheme;
13311335

13321336
for (short int i = 0; i < 8; i++) {

0 commit comments

Comments
 (0)