Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

Error when using ippiWarpBilinearQuad

$
0
0

Hi,

I am using the function ippiWarpBilinearQuad_32f_C1R to warp a 32f image. Then I encounter the error:

Exception thrown at 0x00000000038746EB (ippiu8-5.2.dll) in IPPTest.exe: 0xC0000005: Access violation reading location 0x00000F9C12FC584C.

Below is my codes.

	IMG_RBUF
		rbBufSrc = { 0 },
		rbBufDst = { 0 };
	IppiSize
		srcSize = { 0 };
	IppiRect
		srcRoi = { 0 },
		dstRoi = { 0 };
	double
		srcQuad[4][2] = {
			{ 221.777777777777, 0.0 },
			{ 332.666666666666, 0.0 },
			{ 332.666666666666, 110.888888888888 },
			{ 221.777777777777, 110.888888888888 } },
		dstQuad[4][2] = {
			{ 222.277404785156, 0.500198245048522 },
			{ 333.166290283203, 0.500114262104034 },
			{ 333.166381835937, 111.388999938964 },
			{ 222.27749633789, 111.389083862304 } },
			coeffs[2][4] = { 0 };
	int
		interpolation = IPPI_INTER_LINEAR;
	IppStatus
		ippSts = ippStsNoErr;
	IMG_COORD
		coZ = { 0 };
	char
		acSrcName[] = "E:\\temp\\Src.r.tif",
		acDstName[] = "E:\\temp\\Dst.r.tif";
	
	// rbBufSrc with size 999x999
	// rbBufDst with size 1000x1000
	if (OK != FILE_ImageSize((IMG_UBYTE*)acSrcName, &rbBufSrc.size) ||
		OK != FILE_ImageSize((IMG_UBYTE*)acDstName, &rbBufDst.size))
		goto EXIT;
	rbBufSrc.linestep = rbBufSrc.size.x;
	rbBufDst.linestep = rbBufDst.size.x;
	if (NULL == (rbBufSrc.ptr = (IMG_REAL*)malloc(sizeof(IMG_REAL)*rbBufSrc.size.x*rbBufSrc.size.y)) ||
		NULL == (rbBufDst.ptr = (IMG_REAL*)malloc(sizeof(IMG_REAL)*rbBufDst.size.x*rbBufDst.size.y)))
		goto EXIT;

	if (OK != FILE_LoadImageTiff_r(
		acSrcName, &coZ, &rbBufSrc.size, &rbBufSrc) ||
		OK != FILE_LoadImageTiff_r(
			acDstName, &coZ, &rbBufDst.size, &rbBufDst))
		goto EXIT;

	srcSize.width = rbBufSrc.size.x;
	srcSize.height = rbBufSrc.size.y;
	srcRoi.x = 221;
	srcRoi.y = 0;
	srcRoi.width = 113;
	srcRoi.height = 112;
	dstRoi.x = dstRoi.y = 0;
	dstRoi.width = dstRoi.height = 1000;

	ippSts = ippiWarpBilinearQuad_32f_C1R(
		rbBufSrc.ptr, srcSize, rbBufSrc.linestep * sizeof(IMG_REAL), srcRoi, srcQuad,
		rbBufDst.ptr, rbBufDst.linestep * sizeof(IMG_REAL), dstRoi, dstQuad,
		interpolation);
	if (ippStsNoErr != ippSts)
		goto EXIT;

The last 32bit of the address being accessed when the error occurs is always a certain offset from the address of the buffer pointer
Address violation at 0x00000F9C12FC584C
rbBufSrc.ptr 0x0000000012fd0070
rbBufDst.ptr 0x00000000133a0070

There is no such error when I change the coordinate of the destination quad from 222.27749633789 to 222.27749633790. It seems strange that such small change will affect the address of the memory being accessed.

The IPP version that I am using is 5.2 but I encounter the same problem when I use IPP 2019.

Thank you.


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>