summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-10-06 15:58:44 -0700
committerMathias Agopian <mathias@google.com>2009-10-07 18:03:35 -0700
commitd3144beec6acb37702629799a2adbeccc72ca222 (patch)
tree48feaca0f7fab325bf60d0c2a6de3a425de82926 /libs/ui
parent28541629e163399fd1cac126e06868ecf1b4811e (diff)
downloadframeworks_native-d3144beec6acb37702629799a2adbeccc72ca222.zip
frameworks_native-d3144beec6acb37702629799a2adbeccc72ca222.tar.gz
frameworks_native-d3144beec6acb37702629799a2adbeccc72ca222.tar.bz2
fix [2170283] SurfaceFlinger crashes on OOM.
when running out of memory, a null handle is returned but the error code may not be set. In that case we need to return NO_MEMORY instead of NO_ERROR, so that the calling code won't try to dereference the null pointer.
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/Surface.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/ui/Surface.cpp b/libs/ui/Surface.cpp
index 2d83a8c..f51ca7a 100644
--- a/libs/ui/Surface.cpp
+++ b/libs/ui/Surface.cpp
@@ -746,6 +746,8 @@ status_t Surface::getBufferLocked(int index, int usage)
currentBuffer->setIndex(index);
mNeedFullUpdate = true;
}
+ } else {
+ err = err<0 ? err : NO_MEMORY;
}
}
return err;