summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-11 11:19:04 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-11-11 12:50:24 +0000
commitfeb93d45e872cce23e358527d264693dbbd47607 (patch)
treed658a0da779db87a3c4b5b2b6acab6228719c184
parent72d6f917aeb011394b4545530605f5f932f6ad8f (diff)
vcl: avoid opengl kernel creation writing over its buffers.
Change-Id: I90486137323afc03a23afa6c18c27840fe8456e1
-rw-r--r--vcl/opengl/scale.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 16710b41bdd1..ccacfc4801e4 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -128,6 +128,10 @@ void OpenGLSalBitmap::ImplCreateKernel(
aNumberOfContributions = (static_cast< sal_uInt32 >(fabs(ceil(fScaledRadius))) * 2) + 1 - 6;
aKernelSize = aNumberOfContributions / 2 + 1;
+ // avoid a crash for now; re-think me.
+ if (aKernelSize > 16)
+ aKernelSize = 16;
+
pWeights = new GLfloat[16];
memset( pWeights, 0, 16 * sizeof( GLfloat ) );