/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dict_hw/src/normxcorr_hw.cu.h

  • Committer: Suren A. Chilingaryan
  • Date: 2010-04-17 12:46:07 UTC
  • Revision ID: csa@dside.dyndns.org-20100417124607-bogbojqx0pldekg2
Buffer overflow and range check fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
 
94
94
    size = max3(
95
 
        (1 + CP_BLOCK * ps->fft_alloc_size) * sizeof(cufftComplex),             /* FFT multiplication */
 
95
        ((1 + CP_BLOCK) * ps->fft_alloc_size) * sizeof(cufftComplex),           /* FFT multiplication */
96
96
        2 * CP_BLOCK * ps->side_alloc_size * sizeof(int32_t),                   /* Sum, Std computations */
97
97
        CP_BLOCK * ps->side_alloc_size * (sizeof(int32_t) + sizeof(float))      /* Max of correlation */
98
98
    );
384
384
        int ystart = roundf(y) - half_size;
385
385
    
386
386
        int xend = xstart + size;
387
 
        int yend = xstart + size;
 
387
        int yend = ystart + size;
388
388
 
389
389
        if ((banlist[i])||(xstart < 0)||(ystart < 0)||(xend >= width)||(yend >= height)) {
390
390
            banlist[i] = 1;