aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Esemplare <[email protected]>2013-10-07 09:29:10 -0700
committerMichael Esemplare <[email protected]>2013-10-07 09:29:10 -0700
commited53220b4faccfd184b212bb89a075bfa53ea886 (patch)
tree097557015a2b049de23ca5d3bb75c76329c514b3 /src
parentac1901608c62ae1c5b82bccc3b2a70193031d5f0 (diff)
Fix Bug 365: Bug on javax.media.opengl.glu.GLU.gluBuild2DMipmaps
Fixed convolution window widths for single column scaling.
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java77
1 files changed, 63 insertions, 14 deletions
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 5f086ceff..9c95ae304 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -195,8 +195,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -414,8 +421,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -632,8 +646,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -915,8 +936,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -1210,8 +1238,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -1500,8 +1535,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {
@@ -1797,8 +1839,15 @@ public class ScaleInternal {
highy_int = heightin - 1;
lowx_int = 0;
lowx_float = 0.0f;
- highx_int = convx_int;
- highx_float = convx_float;
+ // If we have a single column, fix the max width values
+ // to prevent buffer overflow
+ if (widthin == 1 && widthout == 1) {
+ highx_int = 0;
+ highx_float = 0.0f;
+ } else {
+ highx_int = convx_int;
+ highx_float = convx_float;
+ }
for( j = 0; j < widthout; j++ ) {