Merge "ui: Fix bad size check in Fence::unflatten" into klp-dev am: 25556811f0 am: 71d3ef1340 am: 5c5ee81b0c am: 05df3a6f4d am: 81bab8081e am: 209ad9b6fe am: d4cbd296d6 am: 593a1a217a am: e3bc28ad88 am: 600e610344 am: ce069c5a07 am: a078c0780c am: 1ceadac71b am: 912ff8af49 am: 161a9bcda1
am: 4c69f0c2e0

Change-Id: Ib725b06a8f1d28843717736a4a014941f4c6abbe
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp
index 02d4137..b67f4d9 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -165,7 +165,7 @@
         return INVALID_OPERATION;
     }
 
-    if (size < 1) {
+    if (size < getFlattenedSize()) {
         return NO_MEMORY;
     }