mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 07:58:16 +02:00
amd/vpelib: Fix potential overflow calculation
[WHY] Multiplication result may overflow int before it is converted to long long [HOW] Updated the expression to avoid possible overflow Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com> Signed-off-by: Muhammad Ansari <Muhammad.Ansari@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39848>
This commit is contained in:
parent
dbff0fabf0
commit
58c544a9bd
1 changed files with 1 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ struct fixed31_32 vpe_fixpt_cos(struct fixed31_32 arg)
|
|||
|
||||
do {
|
||||
res = vpe_fixpt_sub(
|
||||
vpe_fixpt_one, vpe_fixpt_div_int(vpe_fixpt_mul(square, res), n * (n - 1)));
|
||||
vpe_fixpt_one, vpe_fixpt_div_int(vpe_fixpt_mul(square, res), (long long)n * (n - 1)));
|
||||
|
||||
n -= 2;
|
||||
} while (n != 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue