Skip to content

Commit 10b6d0f

Browse files
committed
Check draw array bounds. Closes #1935
1 parent ac86abd commit 10b6d0f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/draw.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,9 @@ int cls_draw::textn(u_char *image
11011101
for (pos = 0; pos < len; pos++) {
11021102
int pos_check = (int)text[pos];
11031103

1104+
if ((pos_check <0) || (pos_check >126)) {
1105+
pos_check = 45; /* Use a - for non ascii characters*/
1106+
}
11041107
char_ptr = char_arr_ptr[pos_check];
11051108

11061109
for (y = 0; y < 8 * factor; y++) {

0 commit comments

Comments
 (0)