Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27631c9c authored by Fan Xu's avatar Fan Xu Committed by Android (Google) Code Review
Browse files

Merge "Fix bufferhubd crash in buffer_hub-test"

parents 7f428258 2cc68fbf
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -25,9 +25,13 @@ BufferChannel::BufferChannel(BufferHubService* service, int buffer_id,
                             uint32_t width, uint32_t height,
                             uint32_t layer_count, uint32_t format,
                             uint64_t usage, size_t user_metadata_size)
    : BufferHubChannel(service, buffer_id, buffer_id, kDetachedBufferType),
      buffer_node_(std::make_shared<BufferNode>(
          width, height, layer_count, format, usage, user_metadata_size)) {
    : BufferHubChannel(service, buffer_id, buffer_id, kDetachedBufferType) {
  buffer_node_ = std::make_shared<BufferNode>(
      width, height, layer_count, format, usage, user_metadata_size);
  if (!buffer_node_->IsValid()) {
    ALOGE("BufferChannel::BufferChannel: Failed to create BufferNode.");
    return;
  }
  client_state_mask_ = buffer_node_->AddNewActiveClientsBitToMask();
}

+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ BufferNode::BufferNode(uint32_t width, uint32_t height, uint32_t layer_count,
  }

  metadata_ = BufferHubMetadata::Create(user_metadata_size);
  if (!metadata_.IsValid()) {
    ALOGE("BufferNode::BufferNode: Failed to allocate metadata.");
    return;
  }
  InitializeMetadata();
}