Access violation in ippiWarpBilinear

Access violation in ippiWarpBilinear


I am getting access violations in ippiWarpBilinear_8u_C1R when run on certain inputs. I am currently testing this with IPP 2018 - Initial Release.

I have boiled it down to this minimal example:

const auto srcSize = IppiSize{ 8439, 54 };
const auto srcRoi = IppiRect{ 2577, 0, 1393, 54 };
const auto srcStep = srcSize.width;
const auto pSrc = ippsMalloc_8u(srcSize.width * srcSize.height);
if (!pSrc)
		throw std::runtime_error("Allocating src failed");

const auto dstSize = IppiSize{ 42, 1386 };
const auto dstRoi = IppiRect{ 0, 0, dstSize.width, dstSize.height };
const auto dstStep = dstSize.width;
const auto pDst = ippsMalloc_8u(dstSize.width * dstSize.height);
if (!pDst)
	throw std::runtime_error("Allocating dst failed");

const double coeffs[2][4] =
	{2.06479e-05, -0.00055722, -0.827145, 42.5322},
	{5.86368e-11, 0.995243, -2.34897e-06, -2563.82},

int bufferSize = -1;
const auto resultBufferSize = ippiWarpBilinearGetBufferSize(srcSize, srcRoi, dstRoi, ippWarpForward, coeffs, IPPI_INTER_LINEAR, &bufferSize);
if (resultBufferSize != ippStsNoErr)
	throw std::runtime_error("Getting buffer size failed");

const auto pBuffer = ippsMalloc_8u(bufferSize);
if (!pBuffer)
	throw std::runtime_error("Allocating buffer failed");

const auto resultWarp = ippiWarpBilinear_8u_C1R(pSrc, srcSize, srcStep, srcRoi, pDst, dstStep, dstRoi, coeffs, IPPI_INTER_LINEAR, pBuffer);
if (resultWarp != ippStsNoErr)
	throw std::runtime_error("Warp failed");

Am I doing something wrong here?

Best regards,


publicaciones de 5 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Probably You wanted to set  const auto dstSize = IppiSize{ 1386, 42 };  instead of  //const auto dstSize = IppiSize{ 42, 1386 }; 

Well, so long as the pointers and sizes are valid I shouldn't get an access violation, right?

I have run a lot of tests to further pin down the issue. It looks as if the access violation is happening when the map is nearly affine, i.e. coeffs[0][0] and coeffs[1][0] are close to zero.

Is anyone looking into this? Can anyone replicate it?

Unless there is an issue with my code above, this has to be an internal bug in ippiWarpBilinear.

We are currently forced to detect coefficients that are likely to cause the access violation but in the long run this is not a viable solution for us.

Please advise.

Best Reply

Hello, Troels!

Thank you for your feedback. We have investigated this issue. It's an internal bug in IPP which will be fixed in the upcoming releases.

Best regards,
Ivan Galanin.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya