summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-12-10 16:08:12 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-10 16:08:12 -0800
commitedfeb1229b2e9788d24fa9b01b2e1fca06f1303f (patch)
tree4acf6cc1eba8d485b2b7458b8489f478d6ecd4c0
parente4bb6e6377b13d5bcac61833e4f90a4f38a36fbc (diff)
parent083a557c25e0032bc4900f335b6643d0badd09ce (diff)
downloadframeworks_base-edfeb1229b2e9788d24fa9b01b2e1fca06f1303f.zip
frameworks_base-edfeb1229b2e9788d24fa9b01b2e1fca06f1303f.tar.gz
frameworks_base-edfeb1229b2e9788d24fa9b01b2e1fca06f1303f.tar.bz2
am 083a557c: fix [2319255] crash in openGL : from the media recorder stress test.
Merge commit '083a557c25e0032bc4900f335b6643d0badd09ce' into eclair-plus-aosp * commit '083a557c25e0032bc4900f335b6643d0badd09ce': fix [2319255] crash in openGL : from the media recorder stress test.
-rw-r--r--libs/surfaceflinger/Layer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index f11bf18..b12c749 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -134,7 +134,14 @@ void Layer::reloadTexture(const Region& dirty)
{
Mutex::Autolock _l(mLock);
sp<GraphicBuffer> buffer(getFrontBufferLocked());
- int index = mFrontBufferIndex;
+ if (buffer == NULL) {
+ // this situation can happen if we ran out of memory for instance.
+ // not much we can do. continue to use whatever texture was bound
+ // to this context.
+ return;
+ }
+
+ const int index = mFrontBufferIndex;
// create the new texture name if needed
if (UNLIKELY(mTextures[index].name == -1U)) {