summaryrefslogtreecommitdiffstats
path: root/opengl/tools
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2013-04-25 15:58:25 -0700
committerAndy McFadden <fadden@android.com>2013-04-25 15:58:25 -0700
commit42137d2e72cebb41f70c4a306877587fd0ea8c20 (patch)
tree75fba8e034ebd849fb605fb3ebd23685db4bbf59 /opengl/tools
parentdfc11ac5c2b1b2d4077eaa268a068d18bde36420 (diff)
downloadframeworks_native-42137d2e72cebb41f70c4a306877587fd0ea8c20.zip
frameworks_native-42137d2e72cebb41f70c4a306877587fd0ea8c20.tar.gz
frameworks_native-42137d2e72cebb41f70c4a306877587fd0ea8c20.tar.bz2
Fix range check
The getarray() function checks to see if there's enough room in the buffer, but it's using a byte count for the available size and a possibly non-byte count for the space required. Dividing down by the unit size corrects the problem. Bug 8713753 Change-Id: Id42c0df65c3233dcc5f76d05e229f7d40d4c1f99
Diffstat (limited to 'opengl/tools')
-rw-r--r--opengl/tools/glgen/stubs/gles11/common.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/common.cpp b/opengl/tools/glgen/stubs/gles11/common.cpp
index 579d573..75b75cb 100644
--- a/opengl/tools/glgen/stubs/gles11/common.cpp
+++ b/opengl/tools/glgen/stubs/gles11/common.cpp
@@ -272,6 +272,7 @@ getarray
int _needed = 0;
params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _remaining /= sizeof(CTYPE); // convert from bytes to item count
_needed = getNeededCount(pname);
// if we didn't find this pname, we just assume the user passed
// an array of the right size -- this might happen with extensions