From b271d5aee9d600194274026e917489b460226dfd Mon Sep 17 00:00:00 2001 From: dupengfei Date: Mon, 30 Dec 2024 11:10:34 +0800 Subject: [PATCH] =?UTF-8?q?UAF=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dupengfei --- content/browser/ohos/software_compositor_host_ohos.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/browser/ohos/software_compositor_host_ohos.cc b/content/browser/ohos/software_compositor_host_ohos.cc index cedf34de61..666c5af089 100644 --- a/content/browser/ohos/software_compositor_host_ohos.cc +++ b/content/browser/ohos/software_compositor_host_ohos.cc @@ -107,7 +107,6 @@ void SoftwareCompositorHostOhos::DemandDrawSwAsync(const char* id, WebSnapchatCallback callback) { TRACE_EVENT0("browser", "SoftwareCompositorHostOhos::DemandDrawSwAsync"); LOG(INFO) << "start DemandDrawSwAsync width:" << clip_width << ", height:" << clip_height; - std::string inputId(id); if (clip_width == 0) { clip_width = MAX_DRAW_SW_SIZE; @@ -125,7 +124,7 @@ void SoftwareCompositorHostOhos::DemandDrawSwAsync(const char* id, if (SkImageInfo::ByteSizeOverflowed(buffer_size)) { LOG(ERROR) << "request snapshot size is too large make skia overflowed"; GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), inputId.c_str(), false, + FROM_HERE, base::BindOnce(std::move(callback), id, false, nullptr, 0, 0)); return; } @@ -134,7 +133,7 @@ void SoftwareCompositorHostOhos::DemandDrawSwAsync(const char* id, if (!software_draw_shm_) { LOG(ERROR) << "set shared memory error"; GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), inputId.c_str(), false, + FROM_HERE, base::BindOnce(std::move(callback), id, false, nullptr, 0, 0)); return; } @@ -143,6 +142,7 @@ void SoftwareCompositorHostOhos::DemandDrawSwAsync(const char* id, blink::mojom::SoftwareCompositorDemandDrawSwParams::New(); params->size = current_; params->offset = offset; + std::string inputId(id); software_compositor_->DemandDrawSwAsync( std::move(params), -- Gitee