mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Merge "Fix bad command length calculation"
am: b44c4d4cd3
Change-Id: I98cb1b59ea42d48375b6f95cc8f88b0e0e79d056
This commit is contained in:
@@ -79,6 +79,7 @@ class CommandWriterBase : public V2_2::CommandWriterBase {
|
||||
|
||||
void setLayerPerFrameMetadataBlobs(
|
||||
const hidl_vec<IComposerClient::PerFrameMetadataBlob>& metadata) {
|
||||
// in units of uint32_t's
|
||||
size_t commandLength = 0;
|
||||
|
||||
if (metadata.size() > std::numeric_limits<uint32_t>::max()) {
|
||||
@@ -86,12 +87,12 @@ class CommandWriterBase : public V2_2::CommandWriterBase {
|
||||
return;
|
||||
}
|
||||
|
||||
// number of blobs
|
||||
commandLength += metadata.size();
|
||||
// space for numElements
|
||||
commandLength += 1;
|
||||
|
||||
for (auto metadataBlob : metadata) {
|
||||
commandLength += sizeof(int32_t); // key of metadata blob
|
||||
commandLength += 1; // size information of metadata blob
|
||||
commandLength += 1; // key of metadata blob
|
||||
commandLength += 1; // size information of metadata blob
|
||||
|
||||
// metadata content size
|
||||
size_t metadataSize = metadataBlob.blob.size() / sizeof(uint32_t);
|
||||
|
||||
Reference in New Issue
Block a user