summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-04 19:50:23 -0700
committerMathias Agopian <mathias@google.com>2009-09-04 19:50:23 -0700
commit0852e674127780a458c96b4df0c1e73af8731f32 (patch)
treefdad147c772d6e71d4a3a8aba169e09a5b41c3ee /libs/surfaceflinger
parent89b9bd4655f5b60628409f9bd4117cafefc6d31b (diff)
downloadframeworks_native-0852e674127780a458c96b4df0c1e73af8731f32.zip
frameworks_native-0852e674127780a458c96b4df0c1e73af8731f32.tar.gz
frameworks_native-0852e674127780a458c96b4df0c1e73af8731f32.tar.bz2
attempt to fix [2099362] Possible SurfaceFlinger crash
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index a72294a..c78921a 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -573,8 +573,10 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags)
// do this without lock held
const size_t count = ditchedLayers.size();
for (size_t i=0 ; i<count ; i++) {
- //LOGD("ditching layer %p", ditchedLayers[i].get());
- ditchedLayers[i]->ditch();
+ if (ditchedLayers[i] != 0) {
+ //LOGD("ditching layer %p", ditchedLayers[i].get());
+ ditchedLayers[i]->ditch();
+ }
}
}
@@ -1082,6 +1084,8 @@ status_t SurfaceFlinger::invalidateLayerVisibility(const sp<LayerBase>& layer)
status_t SurfaceFlinger::addLayer_l(const sp<LayerBase>& layer)
{
+ if (layer == 0)
+ return BAD_VALUE;
ssize_t i = mCurrentState.layersSortedByZ.add(
layer, &LayerBase::compareCurrentStateZ);
sp<LayerBaseClient> lbc = LayerBase::dynamicCast< LayerBaseClient* >(layer.get());