diff --git a/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.cc b/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.cc index e673a73e63e4..e6548e07389e 100644 --- a/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.cc +++ b/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.cc @@ -176,7 +176,8 @@ scoped_refptr BraveSessionCache::PerturbPixels( scoped_refptr BraveSessionCache::PerturbPixelsInternal( scoped_refptr image_bitmap) { - DCHECK(image_bitmap); + if (!image_bitmap) + return nullptr; if (image_bitmap->IsNull()) return image_bitmap; // convert to an ImageDataBuffer to normalize the pixel data to RGBA, 4 bytes diff --git a/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc b/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc index 72a407dbde3b..a55b39fc0f7c 100644 --- a/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc +++ b/chromium_src/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc @@ -14,6 +14,7 @@ brave::GetContentSettingsClientFor(context)) { \ image_ = brave::BraveSessionCache::From(*context).PerturbPixels(settings, \ image_); \ + DCHECK(image_); \ } #include "../../../../../../../../third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc" diff --git a/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index 033ff90ac767..ff596ae7790d 100644 --- a/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/chromium_src/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc @@ -15,6 +15,8 @@ brave::GetContentSettingsClientFor(context)) { \ image_bitmap = brave::BraveSessionCache::From(*context).PerturbPixels( \ settings, image_bitmap); \ + if (!image_bitmap) \ + return String("data:,"); \ } \ }