Problem with nppiResize Function

Hello,

I have used the nppiResize_8u_C1R function in the following code snippet to stretch a 1x44 matrix to a 1x24 matrix of byte values:

Npp8u		* d_Source , * d_Dest ;
NppiSize	SourceSize , DestSize;
NppiRect	SourceRect  ;
														
SourceSize.width = 44 ;
SourceSize.height = 1 ;

SourceRect.x = 0 ;		
SourceRect.y = 0 ;
SourceRect.width = SourceSize.width ; 
SourceRect.height = SourceSize.height ;

DestSize.width = 24 ;	
DestSize.height = 1 ;

cudaMalloc( & d_Source , SourceSize.height * 512 ) ;
cudaMalloc( & d_Dest ,	DestSize.height * 512 ) ;

// Fill Source

NppStatus	nResult =
	nppiResize_8u_C1R(
		d_Source ,
		SourceSize ,
		512 ,
		SourceRect , 
		d_Dest ,
		512 ,
		DestSize ,
		( double ) DestSize.width / ( double ) SourceSize.width ,
		( double ) DestSize.height / ( double ) SourceSize.height ,
		NPPI_INTER_LINEAR ) ;

When I run the code, the function returns error number -20 which stands for NPP_WRONG_INTERSECTION_ROI_ERROR.
If change the source and destination heights to 2 instead of 1, it works smoothly. Can anyone tell me what is wrong?

Thanks,
Ramin