Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippsFIRMRInitAlloc Exception for some values

junioru
Beginner
457 Views
Hello,
I'm using the ippsFIRMRInitAlloc function in my code and some values of upFactor and downFacto causes the function to crash such as when upFactor is 23999 and downFactor is 24000. Is there some limit to the values that can be used or how can I check inputs are safe?
I am running windows 7 64bit OS on a Core 2 Quad and i7 system, have tried linking against IPP 6.1.0.032 and7.0.6.278.
below is the simplified portion of code that throws the exception:
Ipp64f* taps = ippsMalloc_64f(1);
IppsFIRState_64f* pState;
Ipp64f* pDlyLine = NULL;
int p = 23999;
int q = 24000;
ippsFIRMRInitAlloc_64f(&pState,taps,1,p,0,q,0,pDlyLine);
I have other values of p and q such as p = 2399, q = 2400 works fine.
Would appreciate any help,
Thanks
0 Kudos
5 Replies
Andrey_B_Intel
Employee
457 Views
The problem was reproduced.
Actuallyinteger overflow happensduring calculation internal table.In the next release of IPP function will return error state in suchsituation.
0 Kudos
junioru
Beginner
457 Views
Hi, thanks for the reply. in the mean time, would it be possible to provide some idea of what is the range of values that will work so that I can add some code to check the inputs and before the function call to ensure it does not crash my entire program? Thank you.
0 Kudos
Andrey_B_Intel
Employee
457 Views
To work correct the input parameter should satisfy condition
(4 * (Ipp64s)numTaps * downFactor + downPhase) < IPP_MAX_32S
The nearest fixin next IPPrelease will check this condition and return error state.

Thanks.
0 Kudos
SergeyKostrov
Valued Contributor II
457 Views
To work correct the input parameter should satisfy condition
(4 * (Ipp64s)numTaps * downFactor + downPhase) < IPP_MAX_32S
The nearest fixin next IPPrelease will check this condition and return error state.

It would be nice to have that condition in a header file. Now it is clear whyan error happened:

( 4 * 1 * 23999 * 24000 )= 2,303,904,000 > 2,147,483,647

[Updated by SergeyK]
Something is wrong with the condition...
0 Kudos
SergeyKostrov
Valued Contributor II
457 Views
To work correct the input parameter should satisfy condition

(4 * (Ipp64s)numTaps * downFactor + downPhase) < IPP_MAX_32S
...


Andrey,

Could you verify the condition, please? I just noticed that something iswrong. A couple ofmore things:

1. The function 'ippsFIRMRInitAlloc_64f' has7 input argumentsand 1 output argument ( pfState ).

...
st = ::ippsFIRMRInitAlloc_64f( &pfState, pfTaps, iTapsLen, iUpFactor, iUpPhase, iDownFactor, iDownPhase, pfDelayLine );
...

I underlined input arguments with numerical values and I thinkthey have to be taken into accountin
case of verifications.

2. The problem is reproducible with IPP libraries down to version 3.x.

Best regards,
Sergey

0 Kudos
Reply