https://bugs.winehq.org/show_bug.cgi?id=47641
Bug ID: 47641 Summary: Treeview Expand using option TVE_COLLAPSE|TVE_COLLAPSERESET causes crash Product: Wine Version: 4.14 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: comctl32 Assignee: wine-bugs@winehq.org Reporter: leslie_alistair@hotmail.com Distribution: ---
Created attachment 65082 --> https://bugs.winehq.org/attachment.cgi?id=65082 Testcase
When an application call a TreeView Expand function with TVE_COLLAPSE|TVE_COLLAPSERESET options, there is a chance that it will crash the application.
See attached patch for the simplest testcase.
https://bugs.winehq.org/show_bug.cgi?id=47641
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, testcase CC| |bunglehead@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=47641
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|bunglehead@gmail.com |
https://bugs.winehq.org/show_bug.cgi?id=47641
John Alway jwalway@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jwalway@hotmail.com
--- Comment #1 from John Alway jwalway@hotmail.com --- (In reply to Alistair Leslie-Hughes from comment #0)
Created attachment 65082 [details] Testcase
When an application call a TreeView Expand function with TVE_COLLAPSE|TVE_COLLAPSERESET options, there is a chance that it will crash the application.
See attached patch for the simplest testcase.
Hello,
I applied your test patch and studied the problem. I found that in the file dlls/comctl32/treeview.c, and the function TREEVIEW_ComputeItemRect() that infoPtr->firstVisible was equal to null. To fix it I created a patch that changes code in TREEVIEW_Collapse(). I moved the function TREEVIEW_SetFirstVisible() from the end of the function to right before TREEVIEW_RecalculateVisibleOrder(). It's worked for me so far.
I posted the patch to the developer's list under the title: "[PATCH] comctl32: Fix Treeview Expand using TVE_COLLAPSE|TVE_COLLAPSERESET"
Regards, ...John Alway
https://bugs.winehq.org/show_bug.cgi?id=47641
--- Comment #2 from John Alway jwalway@hotmail.com --- Created attachment 65920 --> https://bugs.winehq.org/attachment.cgi?id=65920 Patch fix for the problem.
Just for the sake of completeness, I've uploaded the patch I wrote to fix the bug.
Regards, ...John Alway