From 944533501910a256b59230b9b50daca839055950 Mon Sep 17 00:00:00 2001 From: Ramkumar Radhakrishnan Date: Thu, 9 Aug 2012 20:43:08 -0700 Subject: [PATCH] libgralloc: Allocate buffer Fix. Fix to allocate buffer of size defined by the client using NATIVE_WINDOW_SET_BUFFER_SIZE property function. Change-Id: I29f3e7e85c2f8dd7c11149d78b2681e6478cef78 --- libgralloc/gpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp index e7549c6..7f9182f 100644 --- a/libgralloc/gpu.cpp +++ b/libgralloc/gpu.cpp @@ -200,7 +200,7 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage, if ((ssize_t)size <= 0) return -EINVAL; - size = (bufferSize >= size)? bufferSize : size; + size = (bufferSize != 0)? bufferSize : size; // All buffers marked as protected or for external // display need to go to overlay