Commit 2709b642 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Fix crash in NGLineBreaker::Rewind()

This patch fixes a crash in NGLineBreaker::Rewind(), when
floats cause a call to HandleOverflow() without any
NGInlineItemResult.

Occurred in slack.com.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I1997b719c371141a53327fb81c8731177b0f9be0
Reviewed-on: https://chromium-review.googlesource.com/1129599Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573596}
parent 8e53e8ed
......@@ -1055,7 +1055,8 @@ NGLineBreaker::LineBreakState NGLineBreaker::HandleOverflow(
if (break_anywhere_if_overflow_ && !override_break_anywhere_) {
override_break_anywhere_ = true;
break_iterator_.SetBreakType(LineBreakType::kBreakCharacter);
Rewind(line_info, 0);
if (!item_results->IsEmpty())
Rewind(line_info, 0);
return LineBreakState::kLeading;
}
......
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