diff options
author | Michael Esemplare <[email protected]> | 2013-10-07 09:29:10 -0700 |
---|---|---|
committer | Michael Esemplare <[email protected]> | 2013-10-07 09:29:10 -0700 |
commit | ed53220b4faccfd184b212bb89a075bfa53ea886 (patch) | |
tree | 097557015a2b049de23ca5d3bb75c76329c514b3 /src/jogl/classes/jogamp/opengl/glu/mipmap | |
parent | ac1901608c62ae1c5b82bccc3b2a70193031d5f0 (diff) |
Fix Bug 365: Bug on javax.media.opengl.glu.GLU.gluBuild2DMipmaps
Fixed convolution window widths for single column scaling.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/glu/mipmap')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java | 77 |
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++ ) { |