Checks if multiplying texture width and height would overflow before performing the operation. This avoids incorrect memory allocations and potential crashes with very large textures. Fixes #6358 Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>