Skip to content

Commit

Permalink
Added bounds checks on drawPixel. Fixes error on Thunderbolt
Browse files Browse the repository at this point in the history
  • Loading branch information
ciplogic committed Jul 31, 2018
1 parent af8b88b commit 1336208
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/engine/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,10 @@ float rfPartOfNumber(float x)
// to draw on screen
void Surface::drawPixel(int x, int y, float brightness, const uint32_t col)
{
if (x < 0 || y < 0)
return;
if (x >= surface->w || y >= surface->h)
return;
int finalColA = 255 * brightness;
if (finalColA > 255)
finalColA = 255;
Expand Down

0 comments on commit 1336208

Please sign in to comment.