Merge pull request #2798 from psumbera/master

This array is so big that it eats whole stack for the thread and makes
This commit is contained in:
Marc-André Moreau 2015-08-27 10:15:29 -04:00
commit fdac05b967

View File

@ -90,14 +90,16 @@ int shadow_capture_compare(BYTE* pData1, int nStep1, int nWidth, int nHeight, BY
int l, t, r, b; int l, t, r, b;
BYTE *p1, *p2; BYTE *p1, *p2;
BOOL rows[1024]; BOOL rows[1024];
#ifdef WITH_DEBUG_SHADOW_CAPTURE
BOOL cols[1024]; BOOL cols[1024];
BOOL grid[1024][1024]; #endif
allEqual = TRUE; allEqual = TRUE;
ZeroMemory(rect, sizeof(RECTANGLE_16)); ZeroMemory(rect, sizeof(RECTANGLE_16));
FillMemory(rows, sizeof(rows), 0xFF); FillMemory(rows, sizeof(rows), 0xFF);
#ifdef WITH_DEBUG_SHADOW_CAPTURE
FillMemory(cols, sizeof(cols), 0xFF); FillMemory(cols, sizeof(cols), 0xFF);
FillMemory(grid, sizeof(grid), 0xFF); #endif
nrow = (nHeight + 15) / 16; nrow = (nHeight + 15) / 16;
ncol = (nWidth + 15) / 16; ncol = (nWidth + 15) / 16;
@ -141,9 +143,10 @@ int shadow_capture_compare(BYTE* pData1, int nStep1, int nWidth, int nHeight, BY
if (!equal) if (!equal)
{ {
grid[ty][tx] = FALSE;
rows[ty] = FALSE; rows[ty] = FALSE;
#ifdef WITH_DEBUG_SHADOW_CAPTURE
cols[tx] = FALSE; cols[tx] = FALSE;
#endif
if (l > tx) if (l > tx)
l = tx; l = tx;
@ -179,8 +182,7 @@ int shadow_capture_compare(BYTE* pData1, int nStep1, int nWidth, int nHeight, BY
if (rect->bottom > nHeight) if (rect->bottom > nHeight)
rect->bottom = nHeight; rect->bottom = nHeight;
if (0) #ifdef WITH_DEBUG_SHADOW_CAPTURE
{
char *col_str = calloc(ncol + 1, sizeof(char)); char *col_str = calloc(ncol + 1, sizeof(char));
if (!col_str) if (!col_str)
{ {
@ -211,7 +213,7 @@ int shadow_capture_compare(BYTE* pData1, int nStep1, int nWidth, int nHeight, BY
WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d", WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d",
l, t, r, b, ncol, nrow); l, t, r, b, ncol, nrow);
free(col_str); free(col_str);
} #endif
return 1; return 1;
} }