Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for new names and return types of overflow-checked add/multiply #374

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,14 +1422,14 @@ static SDL_Surface *AllocateAlignedPixels(size_t width, size_t height, SDL_Pixel
*/
if (width > SDL_MAX_SINT32 ||
height > SDL_MAX_SINT32 ||
SDL_size_add_overflow(width, alignment, &pitch) ||
SDL_size_mul_overflow(pitch, bytes_per_pixel, &pitch) ||
!SDL_size_add_check_overflow(width, alignment, &pitch) ||
!SDL_size_mul_check_overflow(pitch, bytes_per_pixel, &pitch) ||
pitch > SDL_MAX_SINT32) {
return NULL;
}
pitch &= ~alignment;

if (SDL_size_mul_overflow(height, pitch, &size)) {
if (!SDL_size_mul_check_overflow(height, pitch, &size)) {
/* Overflow... */
return NULL;
}
Expand Down
Loading