Skip to content

Commit

Permalink
Make sure wrapLength has a valid value.
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Aug 20, 2020
1 parent 265d108 commit f867dfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SDL_ttf.c
Expand Up @@ -3114,7 +3114,9 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text

width = (numLines > 1) ? wrapLength : width;
/* Don't go above wrapLength if you have only 1 line which hasn't been cut */
width = SDL_min((int)wrapLength, width);
if (wrapLength > 0) {
width = SDL_min((int)wrapLength, width);
}
height = rowHeight + lineskip * (numLines - 1);

/* Support alpha blending */
Expand Down

0 comments on commit f867dfa

Please sign in to comment.