summaryrefslogtreecommitdiffstats
path: root/libs
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
commitffae4fcc78d0f280da6052d102b11962fb8041b7 (patch)
tree84620e6958dd21be6852de4b81fa87de50d5f5d9 /libs
parent9cc1817d46d8092865d8f1e7a6391dcae197a26a (diff)
downloadframeworks_base-ffae4fcc78d0f280da6052d102b11962fb8041b7.zip
frameworks_base-ffae4fcc78d0f280da6052d102b11962fb8041b7.tar.gz
frameworks_base-ffae4fcc78d0f280da6052d102b11962fb8041b7.tar.bz2
attempt to fix [2099362] Possible SurfaceFlinger crash
Diffstat (limited to 'libs')
-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());