OSDN Git Service

Merge cherrypicks of [5313290, 5313323, 5313343, 5313415, 5313291, 5313441, 5313557...
authorandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 19 Oct 2018 16:33:45 +0000 (16:33 +0000)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 19 Oct 2018 16:33:45 +0000 (16:33 +0000)
Change-Id: I62e39466baf7cbb474eb521994e39f55b1fd3205

libs/ui/GraphicBuffer.cpp

index c880500..6235bd6 100644 (file)
@@ -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);