Skip to content

Commit

Permalink
[修正] スタックの使いすぎ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
devil-tamachan committed Nov 13, 2014
1 parent 1637ab2 commit e400b73
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Bz/BZView.cpp
Expand Up @@ -2365,7 +2365,8 @@ void CBZView::preQuickSearchWI1(LPCWSTR searchTextW, BYTE nSearchTextW, BYTE *sk
}
UINT64 CBZView::stristrBinaryW1(LPCWSTR searchTextW, BYTE nSearchTextW, UINT64 dwStart)
{
BYTE skipTable[0x10000];
BYTE *skipTable = (BYTE *)malloc(0x10000);
if(skipTable==NULL)return _UI64_MAX; //error
preQuickSearchWI1(searchTextW, nSearchTextW, skipTable);

DWORD dwNeedSize = (nSearchTextW+1)*2;
Expand Down Expand Up @@ -2395,7 +2396,8 @@ void CBZView::preQuickSearchWI4(LPCWSTR searchTextW, DWORD nSearchTextW, DWORD *
}
UINT64 CBZView::stristrBinaryW4(LPCWSTR pSearchTextW, DWORD nSearchTextW, UINT64 dwStart)
{
DWORD skipTable[0x10000];
DWORD *skipTable = (DWORD *)malloc(0x10000 * sizeof(DWORD));
if(skipTable==NULL)return _UI64_MAX; //error
preQuickSearchWI4(pSearchTextW, nSearchTextW, skipTable);

DWORD dwNeedSize = (nSearchTextW+1)*2;
Expand Down Expand Up @@ -2432,8 +2434,10 @@ void CBZView::preQuickSearchAI(LPCSTR searchText, DWORD nSearchText, DWORD *skip
}
UINT64 CBZView::stristrBinaryA(LPCSTR pSearchText, UINT64 dwStart)
{
DWORD *skipTable = (DWORD *)malloc(0x100 * sizeof(DWORD));
if(skipTable==NULL)return _UI64_MAX; //error

DWORD nSearchText = strlen(pSearchText);
DWORD skipTable[0x100];
preQuickSearchAI(pSearchText, nSearchText, skipTable);
UINT64 dwCurrent=dwStart;
m_pDoc->Cache(dwStart);
Expand All @@ -2455,7 +2459,9 @@ void CBZView::preQuickSearch(LPBYTE pSearchByte, unsigned int nSearchByte, DWORD
}
UINT64 CBZView::strstrBinary(LPBYTE pSearchStr, unsigned int nSearchStr, UINT64 dwStart)
{
DWORD skipTable[0x100];
DWORD *skipTable = (DWORD *)malloc(0x100 * sizeof(DWORD));
if(skipTable==NULL)return _UI64_MAX; //error

preQuickSearch(pSearchStr, nSearchStr, skipTable);
UINT64 dwCurrent=dwStart;
m_pDoc->Cache(dwStart);
Expand Down

0 comments on commit e400b73

Please sign in to comment.