summaryrefslogtreecommitdiffstats
path: root/opengl/libagl/array.cpp
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-19 19:03:53 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-19 19:03:53 -0800
commit1a1ce3a6a25b2d2062dff654e1355d48363b9c57 (patch)
tree11af611e559e69017e4318ae1832ae689014d2ab /opengl/libagl/array.cpp
parent585593786208a7506b651f3f431289ed967b5975 (diff)
parenta750fc0bf8bdfd47e058ac51a719716440c7aa98 (diff)
downloadframeworks_native-1a1ce3a6a25b2d2062dff654e1355d48363b9c57.zip
frameworks_native-1a1ce3a6a25b2d2062dff654e1355d48363b9c57.tar.gz
frameworks_native-1a1ce3a6a25b2d2062dff654e1355d48363b9c57.tar.bz2
Merge change I39f0003e into eclair
* changes: fix [2235414] libagl glDeleteBuffers() crashes
Diffstat (limited to 'opengl/libagl/array.cpp')
-rw-r--r--opengl/libagl/array.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/opengl/libagl/array.cpp b/opengl/libagl/array.cpp
index 4878722..71825c5 100644
--- a/opengl/libagl/array.cpp
+++ b/opengl/libagl/array.cpp
@@ -1548,24 +1548,36 @@ void glDeleteBuffers(GLsizei n, const GLuint* buffers)
GLuint name = buffers[i];
if (name) {
// unbind bound deleted buffers...
- if (c->arrays.element_array_buffer->name == name) {
- c->arrays.element_array_buffer = 0;
+ if (c->arrays.element_array_buffer) {
+ if (c->arrays.element_array_buffer->name == name) {
+ c->arrays.element_array_buffer = 0;
+ }
}
- if (c->arrays.array_buffer->name == name) {
- c->arrays.array_buffer = 0;
+ if (c->arrays.array_buffer) {
+ if (c->arrays.array_buffer->name == name) {
+ c->arrays.array_buffer = 0;
+ }
}
- if (c->arrays.vertex.bo->name == name) {
- c->arrays.vertex.bo = 0;
+ if (c->arrays.vertex.bo) {
+ if (c->arrays.vertex.bo->name == name) {
+ c->arrays.vertex.bo = 0;
+ }
}
- if (c->arrays.normal.bo->name == name) {
- c->arrays.normal.bo = 0;
+ if (c->arrays.normal.bo) {
+ if (c->arrays.normal.bo->name == name) {
+ c->arrays.normal.bo = 0;
+ }
}
- if (c->arrays.color.bo->name == name) {
- c->arrays.color.bo = 0;
+ if (c->arrays.color.bo) {
+ if (c->arrays.color.bo->name == name) {
+ c->arrays.color.bo = 0;
+ }
}
for (int t=0 ; t<GGL_TEXTURE_UNIT_COUNT ; t++) {
- if (c->arrays.texture[t].bo->name == name) {
- c->arrays.texture[t].bo = 0;
+ if (c->arrays.texture[t].bo) {
+ if (c->arrays.texture[t].bo->name == name) {
+ c->arrays.texture[t].bo = 0;
+ }
}
}
}