Commit 65026f98 authored by Bhanu Chetlapalli's avatar Bhanu Chetlapalli
Browse files

Prevent bit shifting if num bits is negative


Causes OpenGL Software Renderer to generate incorrect window
coordinates on MIPS & possibly x86

Change-Id: I3c51b6a5a4e6af75e9b31d9d47e4e4d894825888
Signed-off-by: default avatarBhanu Chetlapalli <bhanu@mips.com>
parent 149ae11f
......@@ -62,7 +62,8 @@ int32_t gglRecipQ(GGLfixed x, int q)
int shift;
x = gglRecipQNormalized(x, &shift);
shift += 16-q;
x += 1L << (shift-1); // rounding
if (shift > 0)
x += 1L << (shift-1); // rounding
x >>= shift;
return x;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment