Commit 6ed80043 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Check IsDetached() in ImageDocumentParser::AppendBytes()

It is suspicious that GetDocument() can be nullptr in
ImageDocumentParser::AppendBytes().
This CL adds an IsDetached() check there, just like
DecodedDataDocumentParser::AppendBytes() does.

Bug: 826198
Change-Id: I297fe5bbe609a380ce8a175529d1216a88d1c1ee
Reviewed-on: https://chromium-review.googlesource.com/1050697Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557244}
parent ff0c3108
...@@ -122,6 +122,9 @@ void ImageDocumentParser::AppendBytes(const char* data, size_t length) { ...@@ -122,6 +122,9 @@ void ImageDocumentParser::AppendBytes(const char* data, size_t length) {
if (!length) if (!length)
return; return;
if (IsDetached())
return;
LocalFrame* frame = GetDocument()->GetFrame(); LocalFrame* frame = GetDocument()->GetFrame();
Settings* settings = frame->GetSettings(); Settings* settings = frame->GetSettings();
if (!frame->GetContentSettingsClient()->AllowImage( if (!frame->GetContentSettingsClient()->AllowImage(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment