summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/BufferQueue.cpp')
-rw-r--r--libs/gui/BufferQueue.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index 4640149ac1..2eee6f549b 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -974,6 +974,11 @@ status_t BufferQueue::setDefaultMaxBufferCount(int bufferCount) {
status_t BufferQueue::setMaxAcquiredBufferCount(int maxAcquiredBuffers) {
ATRACE_CALL();
Mutex::Autolock lock(mMutex);
+ if (maxAcquiredBuffers < 1 || maxAcquiredBuffers > MAX_MAX_ACQUIRED_BUFFERS) {
+ ST_LOGE("setMaxAcquiredBufferCount: invalid count specified: %d",
+ maxAcquiredBuffers);
+ return BAD_VALUE;
+ }
if (mConnectedApi != NO_CONNECTED_API) {
return INVALID_OPERATION;
}