wineps: Fix SetTextJustification playback with 0 count parameter.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55078
This commit is contained in:
Piotr Caban 2023-07-09 12:34:21 +02:00 committed by Alexandre Julliard
parent 029bac07e9
commit 75e87c30ad

View file

@ -2792,8 +2792,16 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
{ {
const EMRSETTEXTJUSTIFICATION *p = (const EMRSETTEXTJUSTIFICATION *)rec; const EMRSETTEXTJUSTIFICATION *p = (const EMRSETTEXTJUSTIFICATION *)rec;
data->break_extra = p->break_extra / p->break_count; if (p->break_count)
data->break_rem = p->break_extra - data->break_extra * p->break_count; {
data->break_extra = p->break_extra / p->break_count;
data->break_rem = p->break_extra - data->break_extra * p->break_count;
}
else
{
data->break_extra = 0;
data->break_rem = 0;
}
return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }