Commit f04d8a27 authored by Roman Pišl's avatar Roman Pišl Committed by Alexandre Julliard

user32/edit: Avoid division by zero in EDIT_EM_LineScroll_internal.

parent d5e591d3
...@@ -1674,8 +1674,12 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy) ...@@ -1674,8 +1674,12 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy)
{ {
INT nyoff; INT nyoff;
INT x_offset_in_pixels; INT x_offset_in_pixels;
INT lines_per_page = (es->format_rect.bottom - es->format_rect.top) / INT lines_per_page;
es->line_height;
if (!es->line_height || !es->char_width)
return TRUE;
lines_per_page = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
{ {
......
...@@ -1765,6 +1765,8 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam, ...@@ -1765,6 +1765,8 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam,
ok(r == 1, "Returned %ld, expected 1.\n", r); ok(r == 1, "Returned %ld, expected 1.\n", r);
r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010); r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010);
todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r); todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r);
r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1);
ok(r == 1, "Returned %ld, expected 1.\n", r);
return result; return result;
...@@ -1775,6 +1777,8 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam, ...@@ -1775,6 +1777,8 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam,
ok(r == 1, "Returned %ld, expected 1.\n", r); ok(r == 1, "Returned %ld, expected 1.\n", r);
r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010); r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010);
todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r); todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r);
r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1);
ok(r == 1, "Returned %ld, expected 1.\n", r);
break; break;
} }
......
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