Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit da253af

Browse files
committed
[[ Bug ]] Overflow in dilateXY.
1 parent b58fbf6 commit da253af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libgraphics/src/spread.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ void dilateDistanceXY(const uint8_t *src, uint8_t *dst, int xradius, int yradius
261261
// Avoids excessive processing for rows of non-zero pixels
262262
x = dnext;
263263
next = next + 1;
264-
while (next < width && sptr[next + 1] != 0)
264+
265+
// MW-2014-06-24: [[ Bug ]] Only loop up to (width - 1), otherwise we get
266+
// an access overflow.
267+
while (next < (width - 1) && sptr[next + 1] != 0)
265268
{
266269
xdptr[x] = 0;
267270
x++, next++;

0 commit comments

Comments
 (0)