summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-14 15:59:16 -0700
committerMathias Agopian <mathias@google.com>2009-09-14 15:59:16 -0700
commit53973fda84d3e19642373f50fc33f646e5673584 (patch)
tree7e8157febb5585db1b97d87ca1a1c309396ec186 /libs/surfaceflinger
parentbd8527110caa5427ade0edd7ce0d00e63f15ccbc (diff)
downloadframeworks_base-53973fda84d3e19642373f50fc33f646e5673584.zip
frameworks_base-53973fda84d3e19642373f50fc33f646e5673584.tar.gz
frameworks_base-53973fda84d3e19642373f50fc33f646e5673584.tar.bz2
fix [2117464] SF can crash when calling dumpsys
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index 8685f99..a352431 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -1524,13 +1524,24 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
result.append( l->lcblk->dump(" ") );
sp<const Buffer> buf0(l->getBuffer(0));
sp<const Buffer> buf1(l->getBuffer(1));
+ uint32_t w0=0, h0=0, s0=0;
+ uint32_t w1=0, h1=0, s1=0;
+ if (buf0 != 0) {
+ w0 = buf0->getWidth();
+ h0 = buf0->getHeight();
+ s0 = buf0->getStride();
+ }
+ if (buf1 != 0) {
+ w1 = buf1->getWidth();
+ h1 = buf1->getHeight();
+ s1 = buf1->getStride();
+ }
snprintf(buffer, SIZE,
" "
"format=%2d, [%3ux%3u:%3u] [%3ux%3u:%3u],"
" freezeLock=%p\n",
l->pixelFormat(),
- buf0->getWidth(), buf0->getHeight(), buf0->getStride(),
- buf1->getWidth(), buf1->getHeight(), buf1->getStride(),
+ w0, h0, s0, w1, h1, s1,
l->getFreezeLock().get());
result.append(buffer);
buffer[0] = 0;