Skip to content

Commit

Permalink
Fixed a potential segfault in the text renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Aug 3, 2024
1 parent 3290d0a commit 40e360e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/laybasic/laybasic/layBitmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,14 @@ Bitmap::fill_pattern (int y, int x, const uint32_t *pp, unsigned int stride, uns

while (n > 0 && y >= 0) {

for (unsigned int s = 0; s < stride; ++s) {
for (unsigned int s = 0; s < stride; ++s, pp++) {

int x1 = x + s * 32;

uint32_t p = *pp++;
uint32_t p = *pp;

if (x1 < 0) {
if (x1 <= -32) {
return;
}
int x1 = x + s * 32;
if (x1 <= -32 || x1 >= m_width) {
continue;
} else if (x1 < 0) {
p >>= (unsigned int)-x1;
x1 = 0;
}
Expand Down

0 comments on commit 40e360e

Please sign in to comment.