summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-10-19 16:33:45 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-19 16:33:45 +0000
commit0a91c46726431874f254b01645814485be1b8b18 (patch)
treee118976d66194e4cb64f9f854598bbd2d81054d7
parentde781bbb48d4a307190192313752cd675348abc8 (diff)
parent3aeaef6f2848122c051dd0ecc01624b951303449 (diff)
downloadnative-0a91c46726431874f254b01645814485be1b8b18.tar.gz
Merge cherrypicks of [5313290, 5313323, 5313343, 5313415, 5313291, 5313441, 5313557, 5313344, 5313383, 5313384, 5313324, 5313325, 5313326, 5313294, 5313295, 5313296, 5313498] into oc-m8-releaseandroid-8.1.0_r61android-8.1.0_r60android-8.1.0_r53
Change-Id: I62e39466baf7cbb474eb521994e39f55b1fd3205
-rw-r--r--libs/ui/GraphicBuffer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index c8805000a4..6235bd6cc4 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -372,6 +372,10 @@ status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t&
status_t GraphicBuffer::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
+ if (size < 12 * sizeof(int)) {
+ android_errorWriteLog(0x534e4554, "114223584");
+ return NO_MEMORY;
+ }
int const* buf = static_cast<int const*>(buffer);