summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-10-19 16:25:02 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-19 16:25:02 +0000
commita5c43d50e69846b64615452211537e2677a5368d (patch)
tree640eda727e648a7aeaa7ab8fb6254575081e504d
parente31f6eb5c49e0e638585243ac36ce139b60a6fb1 (diff)
parente6eb42cb2e57747e52e488d54da314bc6eabb546 (diff)
downloadnative-oreo-m7-release.tar.gz
Merge cherrypicks of [5313339, 5313437, 5313318, 5313340, 5313282, 5313283, 5313438, 5313284, 5313341, 5313379, 5313380, 5313319, 5313320, 5313321, 5313285, 5313286, 5313287, 5313497, 5313439] into oc-m7-releaseandroid-8.1.0_r52oreo-m7-release
Change-Id: I6fb2bf1fb11d79b60303b6c9525543c041e3a8d0
-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);