We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArucoUnity/Assets/ArucoUnity/Scripts/Plugins/Cv/Mat.cs
Line 131 in 757f546
In Mat's DataByte accessor the native uchar* object is being directly assigned/returned as a byte[] without marshalling it as a managed object first. This can cause issues such as this: https://issuetracker.unity3d.com/issues/crash-while-inspecting-byteslist-values-of-a-dictionary-in-vs-debugger-when-using-arucounity-plugin
DataByte
uchar*
byte[]
I was able to work around the crash by doing this:
[DllImport("ArucoUnityPlugin")] static extern IntPtr au_cv_Mat_getData_uchar(IntPtr mat); public byte[] DataByte { get { byte[] bytes = new byte[Total()]; IntPtr inputBuffer = au_cv_Mat_getData_uchar(CppPtr); Marshal.Copy(inputBuffer, bytes, 0, (int)Total()); return bytes; } set { au_cv_Mat_setData_uchar(CppPtr, value); } }
Hope this helps! Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ArucoUnity/Assets/ArucoUnity/Scripts/Plugins/Cv/Mat.cs
Line 131 in 757f546
In Mat's
DataByte
accessor the nativeuchar*
object is being directly assigned/returned as abyte[]
without marshalling it as a managed object first. This can cause issues such as this: https://issuetracker.unity3d.com/issues/crash-while-inspecting-byteslist-values-of-a-dictionary-in-vs-debugger-when-using-arucounity-pluginI was able to work around the crash by doing this:
Hope this helps! Thanks!
The text was updated successfully, but these errors were encountered: