Skip to content

Commit

Permalink
Fix CodeQL warning
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 4, 2025
1 parent 1630e99 commit b796b81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Auxiliary/DirectXTexEXR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)

try
{
const int width = static_cast<int>(image.width);
const int height = static_cast<int>(image.height);
const auto width = static_cast<int>(image.width);
const auto height = static_cast<int>(image.height);

#ifdef _WIN32
Imf::RgbaOutputFile file(stream, Imf::Header(width, height), Imf::WRITE_RGBA);
Expand All @@ -529,7 +529,7 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
}
else
{
const uint64_t bytes = image.width * image.height;
const auto bytes = static_cast<uint64_t>(image.width) * static_cast<uint64_t>(image.height);

if (bytes > static_cast<uint64_t>(UINT32_MAX))
{
Expand Down

0 comments on commit b796b81

Please sign in to comment.