I just recently noticed, that ippiFilterBox_32f_C1R can access data beyond the input buffers limits (including external border). Usually this does not cause much of a problem, but of course sometimes this can lead to an access violation. E.g. Microsofts Application Verifier can detect the issue reliably. I can reproduce with IPP 7.1 and 8.0.
An excerpt from the code triggering the problem:
void Convolution::conv2Box_IPP(Ipp32f* in, Ipp32f* out, int dataSizeX, int dataSizeY, int kSize) { IppiSize inSize = { dataSizeX, dataSizeY }; IppiSize outSize = { dataSizeX - kSize + 1, dataSizeY - kSize + 1 }; IppiSize boxSize = { kSize, kSize }; IppiPoint anchor = { (kSize - 1) / 2, (kSize - 1) / 2}; int inStep = dataSizeX * sizeof(Ipp32f); int outStep = dataSizeX * sizeof(Ipp32f); Ipp32f* inOffset = in + inSize.width * anchor.y + anchor.x; Ipp32f* outOffset = out + inSize.width * anchor.y + anchor.x; ippiFilterBox_32f_C1R(inOffset, inStep, outOffset, outStep, outSize, boxSize, anchor); } //... float* a = new float[sizeY * sizeX]; float* ai = new float[sizeY * sizeX]; //... Convolution::conv2Box_IPP(ai, a, sizeX, sizeY, filterSizeRho);
The input sizes are something like 400x300. The filter size equals 11 or 31.
Is this a bug in ippiFilterBox? Only in ippiFilterBox?
Must I use the ippiMalloc functions when working with ippiFilter functions? This would add quite a bit extra complexity and overhead - as the input buffer is passed in as an argument - the caller should not need to know I use IPP internally.
Any thoughts on this?
regards
Harald
PS: The Application Verifier catches the access at ippip8-8.0.dll!0956b1d0() ; ippip8-8.0.dll loaded at 08C40000-098D5000*