Fix incorrect usage of wcslen on a StringPiece
The call to wcslen on a StringPiece is incorrect. There is no guarantee that the string is NUL terminated. As stated on crbug/624905: "Problem is that gfx::RenderTextHarfBuzz::ShapeRun is asking for fallback for an empty string but claims it's of length 1. This confuses DirectWrite and it crashes. Can easily work around the crash by checking for empty string, but still need to investigate why gfx::RenderTextHarfBuzz::ShapeRun is getting confused." The reason of the code was to avoid a broken case with ShapeRuns. The empty string is no longer accepted in any GetFallbackFont(...) Bug: 624905 Change-Id: I32e2583c0b87084ece549bf18b611ed7ae8f8c72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612045 Commit-Queue: Etienne Bergeron <etienneb@chromium.org> Commit-Queue: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by:Alexei Svitkine <asvitkine@chromium.org> Cr-Commit-Position: refs/heads/master@{#660086}
Showing
Please register or sign in to comment