Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions Docs/ChangeLog-5x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The 5.5.0 release is a minor maintenance release.
* **Bug fix:** Add missing low-clamp when storing decompressed HDR data into
a UNORM8 image. Prior to this fix, output colors would be incorrect if a
HDR void-extent block contained a negative FP16 color value.
* **Bug fix:** Avoid undefined NaN to int conversion behavior that is
triggered by NaNs generated by atan2() calls where both inputs are zero.

<!-- ---------------------------------------------------------------------- -->
## 5.4.0
Expand Down
6 changes: 5 additions & 1 deletion Source/astcenc_weight_align.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2025 Arm Limited
// Copyright 2011-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -130,6 +130,10 @@ static void compute_angular_offsets(
}

vfloat angle = atan2(anglesum_y, anglesum_x);

// Suppress NaNs generated if anglesums are both zero
angle = select(vfloat::zero(), angle, angle == angle);

vfloat ofs = angle * mult;
storea(ofs, offsets + i);
}
Expand Down
Loading