Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dplong
Beginner
62 Views

Access violation in ippiResizeYUV422_8u_C2R

Why is ippiResizeYUV422_8u_C2R() reading the byte immediately after my image?

These are the arguments I'm passing to ippiResizeYUV422_8u_C2R() (IPP v7.0):
0x09505000, {704, 480}, 1408, {94, 126, 516, 353}, 0x07A10000, 924, {462, 316}, 0.895349, 0.895184, 2

So you don't have to look it up, here is the function prototype:

[cpp]IppStatus ippiResizeYUV422_8u_C2R(const Ipp8u* pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp8u* pDst, int dstStep, IppiSize dstRoiSize, double xFactor, double yFactor, int interpolation);[/cpp]
And this is the diagnostic from Visual Studio 2005 (note the address being accessed):

First-chance exception at 0x00eae8c4 in MainServer.exe: 0xC0000005: Access violation reading location 0x095aa000.

I assume the exception is being triggered while reading the source ROI. I believe that this equation represents the address of the last byte of the source ROI:
[cpp]pSrc + srcRoi.y * srcStep + (srcRoi.x + srcRoi.width) * srcStep / srcSize.width - 1[/cpp]
=
0x09505000 + 126 * 1408 + (94 + 516) * 1408 / 704 - 1
=
0x09530965

So the last byte the function should read in my image is at 0x09530965 yet it's attempting to read from 0x095aa000. I guess my math is off and/or I don't understand the parameters that the function takes.

Thanks,
Paul
0 Kudos
1 Reply
dplong
Beginner
62 Views

Never mind. I changed how I calculate arguments to the function and no longer have this problem.
Reply