Commit 200d795f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Reject invalid values in SetMiterLimit().

parent 3f304014
...@@ -1372,6 +1372,7 @@ BOOL WINAPI SetMiterLimit( HDC hdc, FLOAT limit, FLOAT *old_limit ) ...@@ -1372,6 +1372,7 @@ BOOL WINAPI SetMiterLimit( HDC hdc, FLOAT limit, FLOAT *old_limit )
DC_ATTR *dc_attr; DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_SetMiterLimit( dc_attr, limit )) return 0; if (dc_attr->emf && !EMFDC_SetMiterLimit( dc_attr, limit )) return 0;
if (limit < 1.0f) return FALSE;
if (old_limit) *old_limit = dc_attr->miter_limit; if (old_limit) *old_limit = dc_attr->miter_limit;
dc_attr->miter_limit = limit; dc_attr->miter_limit = limit;
return TRUE; return TRUE;
......
...@@ -101,15 +101,12 @@ static void test_dc_values(void) ...@@ -101,15 +101,12 @@ static void test_dc_values(void)
limit = 456.0; limit = 456.0;
ret = SetMiterLimit(hdc, 0.9f, &limit); ret = SetMiterLimit(hdc, 0.9f, &limit);
todo_wine
ok(!ret, "Unexpected return value.\n"); ok(!ret, "Unexpected return value.\n");
todo_wine
ok(limit == 456.0f, "Unexpected default miter limit %f.\n", limit); ok(limit == 456.0f, "Unexpected default miter limit %f.\n", limit);
limit = 0.0; limit = 0.0;
ret = SetMiterLimit(hdc, 1.0f, &limit); ret = SetMiterLimit(hdc, 1.0f, &limit);
ok(ret, "Unexpected return value.\n"); ok(ret, "Unexpected return value.\n");
todo_wine
ok(limit == 10.0f, "Unexpected default miter limit %f.\n", limit); ok(limit == 10.0f, "Unexpected default miter limit %f.\n", limit);
DeleteDC( hdc ); DeleteDC( hdc );
......
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