mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-21 01:45:30 -04:00
[web]check drawsize height and width before paint to prevent invalid input
Signed-off-by: liwenzhen <liwenzhen3@huawei.com> Change-Id: Id3699ce90170e2e9cbf17f4d04428d2fdbc8d21a
This commit is contained in:
@@ -45,7 +45,16 @@ void RosenRenderWeb::OnAttachContext()
|
||||
|
||||
void RosenRenderWeb::Paint(RenderContext& context, const Offset& offset)
|
||||
{
|
||||
auto pipelineContext = context_.Upgrade();
|
||||
if (!pipelineContext) {
|
||||
LOGE("OnAttachContext context null");
|
||||
return;
|
||||
}
|
||||
if (drawSize_.Width() > pipelineContext->GetRootWidth() || drawSize_.Height() > pipelineContext->GetRootHeight()) {
|
||||
LOGE("Web drawSize height or width is invalid");
|
||||
}
|
||||
if (delegate_) {
|
||||
LOGI("Web paint drawSize width = %{public}f, height = %{public}f", drawSize_.Width(), drawSize_.Height());
|
||||
delegate_->Resize(drawSize_.Width(), drawSize_.Height());
|
||||
if (!isUrlLoaded_) {
|
||||
delegate_->LoadUrl();
|
||||
|
||||
Reference in New Issue
Block a user