summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-02 19:24:17 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-02 19:24:17 +0200
commitb7def61d92368c71680fac59048a251b4f4d7d57 (patch)
treebfda475401b796d8446634ef2d17c5cb06f24664 /libs
parent77561dae684892fc6977216621cb72b7be8bf64e (diff)
parente34afe0a4bd8092cca89a607c994124a9ddb28b9 (diff)
downloadframeworks_native-replicant-6.0.zip
frameworks_native-replicant-6.0.tar.gz
frameworks_native-replicant-6.0.tar.bz2
Merge branch 'cm-13.0' of https://github.com/LineageOS/android_frameworks_native into replicant-6.0HEADreplicant-6.0-0001replicant-6.0
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/Parcel.cpp4
-rw-r--r--libs/gui/BufferQueueProducer.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 65e67d6..4690a82 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -553,7 +553,7 @@ status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len)
// grow objects
if (mObjectsCapacity < mObjectsSize + numObjects) {
size_t newSize = ((mObjectsSize + numObjects)*3)/2;
- if (newSize < mObjectsSize) return NO_MEMORY; // overflow
+ if (newSize*sizeof(binder_size_t) < mObjectsSize) return NO_MEMORY; // overflow
binder_size_t *objects =
(binder_size_t*)realloc(mObjects, newSize*sizeof(binder_size_t));
if (objects == (binder_size_t*)0) {
@@ -1113,7 +1113,7 @@ restart_write:
}
if (!enoughObjects) {
size_t newSize = ((mObjectsSize+2)*3)/2;
- if (newSize < mObjectsSize) return NO_MEMORY; // overflow
+ if (newSize*sizeof(binder_size_t) < mObjectsSize) return NO_MEMORY; // overflow
binder_size_t* objects = (binder_size_t*)realloc(mObjects, newSize*sizeof(binder_size_t));
if (objects == NULL) return NO_MEMORY;
mObjects = objects;
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index a941e2d..5db0b37 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -1091,6 +1091,7 @@ status_t BufferQueueProducer::setGenerationNumber(uint32_t generationNumber) {
String8 BufferQueueProducer::getConsumerName() const {
ATRACE_CALL();
+ Mutex::Autolock lock(mCore->mMutex);
BQ_LOGV("getConsumerName: %s", mConsumerName.string());
return mConsumerName;
}