Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (i_width_aligned > UINT64_MAX/i_height_aligned)
- error();
- uint64_t i_pixels_divided = ((uint64_t)i_width_aligned * i_height_aligned) / 8;
- size_t bpp = p_pic->format.i_bits_per_pixel;
- if (i_pixels_divided > SIZE_MAX/bpp)
- error();
- uint64_t i_bytes = i_pixels_divided * bpp;
- // use i_bytes to allocate space; no need for any more checks.
Add Comment
Please, Sign In to add comment