[PATCH v4 0/1] MR2941: Prevent NULL pointer in editor_ensure_visible when retrieving row from cursor.
This is to prevent NULL pointers when creating a TextService with no rows in it. This NULL pointers doesn't happen when creating a richedit windows, because it sets an empty text when the richedit window procedure handles the WM_CREATE event. -- v4: riched20: Call ME_UpdateRepaint instead of editor_ensure_visible in set_selection. https://gitlab.winehq.org/wine/wine/-/merge_requests/2941
From: Santino Mazza <smazza(a)codeweavers.com> To prevent cases where ME_WrapMarkedParagraphs has not been called causing a NULL pointer when editor_ensure_visible tries to get the row from the cursor. We call ME_UpdateRepaint because some programs using Microsoft Forms crash when using the set_selection function if we only call ME_WrapMarkedParagraphs. --- dlls/riched20/editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 412648d9116..0c6ae4e8651 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2150,7 +2150,7 @@ int set_selection( ME_TextEditor *editor, int to, int from ) if (!editor->bHideSelection) ME_InvalidateSelection( editor ); end = set_selection_cursors( editor, to, from ); - editor_ensure_visible( editor, &editor->pCursors[0] ); + ME_UpdateRepaint(editor, FALSE); if (!editor->bHideSelection) ME_InvalidateSelection( editor ); update_caret( editor ); ME_SendSelChange( editor ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2941
participants (2)
-
Santino Mazza -
Santino Mazza (@tati1454)