summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-07 18:42:38 -0700
committerRomain Guy <romainguy@google.com>2012-09-07 18:42:38 -0700
commite49d7ec36132f33b7c9e2c044ab9dd3585aa3747 (patch)
tree1321a0c086c3b17de0d3c4a62645f672fa511d6d /libs
parent1558cf1498ecc687532f2dad3de720053dca9309 (diff)
downloadframeworks_base-e49d7ec36132f33b7c9e2c044ab9dd3585aa3747.zip
frameworks_base-e49d7ec36132f33b7c9e2c044ab9dd3585aa3747.tar.gz
frameworks_base-e49d7ec36132f33b7c9e2c044ab9dd3585aa3747.tar.bz2
Fix memory corruption in LayerRenderer::copyLayer
The pixel store pack alignment was not set for the source texture, causing a write to occur outside of the destination bitmap's bounds. Change-Id: Iaa5767acf7b5943fbc2765c3810a142f06b1a796
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/LayerRenderer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index f81640b..5a8f2b7 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -400,6 +400,8 @@ bool LayerRenderer::copyLayer(Layer* layer, SkBitmap* bitmap) {
caches.activeTexture(0);
glBindTexture(GL_TEXTURE_2D, texture);
+ glPixelStorei(GL_PACK_ALIGNMENT, bitmap->bytesPerPixel());
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);