summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-17 11:46:20 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-17 11:46:20 -0800
commitce51c10fc139c9383229ff21698bdc72fe83c8d0 (patch)
tree9cfa0803d51de5afb265f5500d2a702eb41156c1 /opengl
parent0ecd89bce353e2d25047628eca7ffa3c79cd5c7b (diff)
parent2030d78dc9c20d2f561f4b11f1a1adddb63661c6 (diff)
downloadframeworks_base-ce51c10fc139c9383229ff21698bdc72fe83c8d0.zip
frameworks_base-ce51c10fc139c9383229ff21698bdc72fe83c8d0.tar.gz
frameworks_base-ce51c10fc139c9383229ff21698bdc72fe83c8d0.tar.bz2
am 2030d78d: am 8fc3540f: Merge "be a bit more defensive when parsing extension strings" into ics-mr1
* commit '2030d78dc9c20d2f561f4b11f1a1adddb63661c6': be a bit more defensive when parsing extension strings
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/egl_display.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 862b48d..31119f9 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -220,15 +220,19 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
if (end) {
// length of the extension string
const size_t len = end - start;
- // NOTE: we could avoid the copy if we had strnstr.
- const String8 ext(start, len);
- // now go through all implementations and look for this extension
- for (int i = 0; i < IMPL_NUM_IMPLEMENTATIONS; i++) {
- // if we find it, add this extension string to our list
- // (and don't forget the space)
- const char* match = strstr(disp[i].queryString.extensions, ext.string());
- if (match && (match[len] == ' ' || match[len] == 0)) {
- mExtensionString.append(start, len+1);
+ if (len) {
+ // NOTE: we could avoid the copy if we had strnstr.
+ const String8 ext(start, len);
+ // now go through all implementations and look for this extension
+ for (int i = 0; i < IMPL_NUM_IMPLEMENTATIONS; i++) {
+ if (disp[i].queryString.extensions) {
+ // if we find it, add this extension string to our list
+ // (and don't forget the space)
+ const char* match = strstr(disp[i].queryString.extensions, ext.string());
+ if (match && (match[len] == ' ' || match[len] == 0)) {
+ mExtensionString.append(start, len+1);
+ }
+ }
}
}
// process the next extension string, and skip the space.