access violation in copyTo
I am reading an image from IPCamera (using VLC API). I store this image in cv::Mat
called ipCameraImage
. Then I am doing deep-copy for this Mat into another Mat using:
auto frame=ipCameraImage.clone();
Everything seems fine. However, after around 1 hour of successful streaming, I got error access violation
in the cloning process exactly inside copyTo
function
.. at the line:
memcpy( dptr, sptr, len );
It says that dptr
point to NULL
!
I am sure that ipCameraImage
is not empty and it is contains valid image (I debug it and show it using ImageWatch tool with VS.NET).
It seems like a bug for me.. is it? Any suggestion?
It's difficult to understand your problem without a small example. May you shoul try to manange memory using this method
Thanks for reply.. I tired sth similar..I create a matheader and allocate the memory then tried to use copyto.. till now no crash but I can no be positive since sometimes it took 1 hour till crashing.. anyway.. there is no much thing to show.. a simple clone method is causing the problem.. it is the first statement after reading from ipcamera and it work for long time before crashing... :/
try with a webcam