summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-08-04 20:53:59 -0700
committerMathias Agopian <mathias@google.com>2009-08-05 12:22:30 -0700
commit3eded949243c8d331190d3803b5c5c2bf2a058fc (patch)
treea93a55378f5b03426ee7822b7d2304775a2eed9c
parent591018aaf9e95b9d2f6d9742194e940605b1bffa (diff)
downloadframeworks_native-3eded949243c8d331190d3803b5c5c2bf2a058fc.zip
frameworks_native-3eded949243c8d331190d3803b5c5c2bf2a058fc.tar.gz
frameworks_native-3eded949243c8d331190d3803b5c5c2bf2a058fc.tar.bz2
don't crash when SurfaceBuffer::writeToParcel is given a null argument
-rw-r--r--libs/ui/Surface.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ui/Surface.cpp b/libs/ui/Surface.cpp
index a4710aa..c73909f 100644
--- a/libs/ui/Surface.cpp
+++ b/libs/ui/Surface.cpp
@@ -108,6 +108,9 @@ status_t SurfaceBuffer::unlock()
status_t SurfaceBuffer::writeToParcel(Parcel* reply,
android_native_buffer_t const* buffer)
{
+ if (buffer == NULL) {
+ return BAD_VALUE;
+ }
reply->writeInt32(buffer->width);
reply->writeInt32(buffer->height);
reply->writeInt32(buffer->stride);