Skip to content

Commit

Permalink
Fix bounds check in RenderClxOutline()
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills authored and AJenbo committed Sep 24, 2024
1 parent d7b5a0c commit b78ec23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/engine/render/clx_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ void RenderClxOutline(const Surface &out, Point position, ClxSprite sprite, uint
UpdateOutlinePixelsCache<SkipColorIndexZero>(sprite);
--position.x;
position.y -= sprite.height();
if (position.x >= 0 && position.x + sprite.width() < out.w()
&& position.y >= 0 && position.y + sprite.height() < out.h()) {
if (position.x >= 0 && position.x + sprite.width() + 2 < out.w()
&& position.y >= 0 && position.y + sprite.height() + 2 < out.h()) {
for (const auto &[x, y] : OutlinePixelsCache.outlinePixels) {
*out.at(position.x + x, position.y + y) = color;
}
Expand Down

0 comments on commit b78ec23

Please sign in to comment.