Commit 470ed3c5 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Avoid possible out-of-bounds cluster metrics access.

parent 8ad509ed
......@@ -2089,7 +2089,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
*/
if (layout->len == 0)
hr = layout_set_dummy_line_metrics(layout, 0);
else if (layout->clustermetrics[layout->cluster_count - 1].isNewline)
else if (layout->cluster_count && layout->clustermetrics[layout->cluster_count - 1].isNewline)
hr = layout_set_dummy_line_metrics(layout, layout->len - 1);
if (FAILED(hr))
return hr;
......
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