Fix a buffer overflow in blink::HarfBuzzShaper::resolveCandidateRuns()
Fix a buffer overflow in blink::HarfBuzzShaper::resolveCandidateRuns()

The capacity value passed to uscript_getScriptExtensions() is
incorrectly calculated as sizeof(scriptExtensions). This results in a
buffer overflow when ICU returns more than 8 script codes.

Fix the above issue by correctly passing the number of elements the
scriptExtensions array can hold as the capacity parameter.

Additionally, expand the scriptExtensions array to USCRIPT_CODE_LIMIT
elements, to account for extra script codes returned by ICU 54.1.

Note: USCRIPT_CODE_LIMIT is probably much larger than the maximum number
      of scripts that ICU will return. For example, ICU 54.1 specifies
      USCRIPT_CODE_LIMIT to be 167, while the maximum value returned by
      uscript_getScriptExtensions() is 17 (for code points in 0..0x10ffff).

      We could use a much smaller array, but in the case it becomes
      insufficient in the future, the U_BUFFER_OVERFLOW_ERROR error
      returned by ICU would be silently ignored.

BUG=445075

Review URL: https://codereview.chromium.org/868393002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@188995 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Pluto-tv/blink-crosswalk,smishenk/blink-crosswalk,kurli/blink-crosswalk,Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,kurli/blink-crosswalk,smishenk/blink-crosswalk,kurli/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,kurli/blink-crosswalk,smishenk/blink-crosswalk,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,kurli/blink-crosswalk,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,kurli/blink-crosswalk,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,Pluto-tv/blink-crosswalk,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,XiaosongWei/blink-crosswalk,XiaosongWei/blink-crosswalk,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,smishenk/blink-crosswalk,smishenk/blink-crosswalk,PeterWangIntel/blink-crosswalk,smishenk/blink-crosswalk