summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimone Contini <s.contini@oltrelinux.com>2011-05-23 21:34:55 +0200
committerBrian Paul <brianp@vmware.com>2011-05-24 09:11:20 -0600
commitcf022fe9dce1406803fea72b8a4b011a1d41303d (patch)
treed7fe4370d6b9c534cda369f471d1c8be1f3225ce
parent3aa148ab51196075265c08b5a18dcdd35dcf6a05 (diff)
Fix bug ID: 2957996 - Wrong results when executing readpixPerf
cast to double added to the first argument expression to prevent the integer overflow Signed-off-by: Simone Contini <s.contini@oltrelinux.com> Signed-off-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/glean/treadpixperf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glean/treadpixperf.cpp b/src/glean/treadpixperf.cpp
index 7ad3d42..813dfdb 100644
--- a/src/glean/treadpixperf.cpp
+++ b/src/glean/treadpixperf.cpp
@@ -207,7 +207,7 @@ ReadpixPerfTest::runNonPBOtest(int formatNum, GLsizei width, GLsizei height,
delete buffer;
- double rate = width * height * iter / elapsedTime / 1000000.0;
+ double rate = static_cast<double>(width) * height * iter / elapsedTime / 1000000.0;
return rate;
}
@@ -299,7 +299,7 @@ ReadpixPerfTest::runPBOtest(int formatNum, GLsizei width, GLsizei height,
delete b;
#endif
- double rate = width * height * iter / elapsedTime / 1000000.0;
+ double rate = static_cast<double>(width) * height * iter / elapsedTime / 1000000.0;
return rate;
#else
return 0.0;