[Frhed-commits] SF.net SVN: frhed:[220] trunk
Brought to you by:
kimmov
From: <ki...@us...> - 2008-12-30 16:52:03
|
Revision: 220 http://frhed.svn.sourceforge.net/frhed/?rev=220&view=rev Author: kimmov Date: 2008-12-30 16:52:00 +0000 (Tue, 30 Dec 2008) Log Message: ----------- Fix a crash in Encode/Decode dialog when selection start is bigger than selection end. Merged Jochen's fix from WinMerge (WinMerge r6169) Modified Paths: -------------- trunk/Docs/Users/ChangeLog.txt trunk/FRHED/gktools.cpp Modified: trunk/Docs/Users/ChangeLog.txt =================================================================== --- trunk/Docs/Users/ChangeLog.txt 2008-12-30 15:28:30 UTC (rev 219) +++ trunk/Docs/Users/ChangeLog.txt 2008-12-30 16:52:00 UTC (rev 220) @@ -6,6 +6,7 @@ Frhed 1.3.4 Bugfix: Replacing data with longer data jammed Frhed (#2431267) + Bugfix: Crash in Encode/Decode dialog (r220) Frhed 1.3.3 - 2008-12-04 (r188) Update homepage URL in About-dialog to Sf.net (r137) Modified: trunk/FRHED/gktools.cpp =================================================================== --- trunk/FRHED/gktools.cpp 2008-12-30 15:28:30 UTC (rev 219) +++ trunk/FRHED/gktools.cpp 2008-12-30 16:52:00 UTC (rev 220) @@ -177,17 +177,16 @@ int nCurSel = SendMessage(hListbox, LB_GETCURSEL, 0, 0); if (nCurSel < 0) return TRUE; - mc.fpEncodeFunc = (LPFNEncodeMemoryFunction) SendMessage(hListbox,LB_GETITEMDATA,nCurSel,0); + mc.fpEncodeFunc = (LPFNEncodeMemoryFunction) SendMessage(hListbox, LB_GETITEMDATA, nCurSel, 0); + int lower = 0; + int upper = DataArray.GetUpperBound(); if (bSelected) { - mc.lpbMemory = &DataArray[iStartOfSelection]; - mc.dwSize = iEndOfSelection - iStartOfSelection + 1; + lower = iGetStartOfSelection(); + upper = iGetEndOfSelection(); } - else - { - mc.lpbMemory = DataArray; - mc.dwSize = DataArray.GetLength(); - } + mc.lpbMemory = &DataArray[lower]; + mc.dwSize = upper - lower + 1; mc.fpEncodeFunc(&mc); iFileChanged = TRUE; bFilestatusChanged = TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |