I have a problem when reading the fingerprints on the zk9500, I get a memory error

I tried it with both x86 and x64 libraries but they give me the same error, at first it captures the fingerprint and shows it but after doing several fingerprint tests the error appears, perhaps the allowed memory is full and I should empty it with each fingerprint reading or maybe the value entered is null.
In addition, the data that enters the variables shown in the image are:
- FPBuffer = 90000
- CapTmp = 2048
- cbCapTmp = 2048 For FPBuffer there are:
- mfpWidth = 300
- mfpHeight = 300
I'm use this demo text and I adapt it to my C# project, I use all your code as indicated
Could someone help me on how to debug to find the problem or I would also like if someone could tell me what I'm doing wrong.
I think there is an initialization problem. Fingerprint template that is read is not always of the same size so maybe you have some kind of buffer overrun. Also, I recommend using
zkfp2object everywhere instead of a new instance ofzkfp.Please, try the following code:
both
_fpWidthand_fpHeightare retrieved the same way as the demo, and_devHandleis the result ofzkfp2.OpenDevice(0).By using
zkfp2everywhere (instead a creating a new instance ofzkfp) you have to make some other changes in the demo code as well.For example, to open the device, use
_devHandle = zkfp2.OpenDevice(0)and to close it,zkfp2.CloseDevice(_devHandle).To initialize the library, use
zkfp2.Init()and to terminate it,zkfp2.Terminate().To initialize the database, use
_dbHandle = zkfp2.DBInit()and to free it,zkfp2.DBFree(_dbHandle).Also, make sure you are using the last version of the ZK Finger libraries.