Skip to content

Commit

Permalink
#2220: fixed crash with invalid mouse sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed Aug 16, 2023
1 parent 22c8bb3 commit 2324f28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/studio/studio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ static void blitCursor(Studio* studio)

if(tic->input.mouse && !m->relative && m->x < TIC80_FULLWIDTH && m->y < TIC80_FULLHEIGHT)
{
s32 sprite = tic->ram->vram.vars.cursor.sprite;
s32 sprite = CLAMP(tic->ram->vram.vars.cursor.sprite, 0, TIC_BANK_SPRITES - 1);
const tic_bank* bank = &tic->cart.bank0;

tic_point hot = {0};
Expand All @@ -2155,7 +2155,7 @@ static void blitCursor(Studio* studio)
{0, 0},
{3, 0},
{2, 3},
}[sprite];
}[CLAMP(sprite, 0, 2)];
}
else if(sprite == 0) return;

Expand Down

0 comments on commit 2324f28

Please sign in to comment.