Fix potential overflow in Texture::getCachedTextureInfo.