changeset 9741:0a6bf601c941

8040808: Uninitialised memory in OGLBufImgsOps.c, D3DBufImgOps.cpp Reviewed-by: serb, pchelko
author prr
date Tue, 15 Jul 2014 10:14:48 -0700
parents 8a5661948eb8
children 3eaad851893f
files src/share/native/sun/java2d/opengl/OGLBufImgOps.c src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	Tue Jul 15 14:41:43 2014 +0400
+++ b/src/share/native/sun/java2d/opengl/OGLBufImgOps.c	Tue Jul 15 10:14:48 2014 -0700
@@ -636,6 +636,9 @@
                 "OGLBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
                 shortData, numBands, bandLength, offset);
 
+    for (i = 0; i < 4; i++) {
+        bands[i] = NULL;
+    }
     RETURN_IF_NULL(oglc);
     RETURN_IF_NULL(srcOps);
     RESET_PREVIOUS_OP();
--- a/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp	Tue Jul 15 14:41:43 2014 +0400
+++ b/src/windows/native/sun/java2d/d3d/D3DBufImgOps.cpp	Tue Jul 15 10:14:48 2014 -0700
@@ -201,6 +201,9 @@
     int i;
     jint flags = 0;
 
+    for (i = 0; i < 4; i++) {
+        bands[i] = NULL;
+    }
     J2dTraceLn4(J2D_TRACE_INFO,
                 "D3DBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
                 shortData, numBands, bandLength, offset);