Skip to content
New issue

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

App crash when click on grab frame. #1

Open
TripleSM opened this issue Oct 19, 2022 · 2 comments
Open

App crash when click on grab frame. #1

TripleSM opened this issue Oct 19, 2022 · 2 comments

Comments

@TripleSM
Copy link

TripleSM commented Oct 19, 2022

System.OverflowException
HResult=0x80131516
Message=Arithmetic operation resulted in an overflow.
Source=System.Private.CoreLib
StackTrace:
at System.IntPtr.ToInt32()
at WinUI3_DirectShow_Capture.MainWindow.d__132.MoveNext() in C:\Workbench\WinUI3_DirectShow_Capture-master\MainWindow.xaml.cs:line 309

@castorix
Copy link
Owner

I cannot reproduce this problem (Windows 10 21H1, unpackaged, x86 or x64)

@mimregit
Copy link

mimregit commented Nov 8, 2023

You probably run the app in 64 bit mode.
The problem occures, when copying the DIB to the byte array.
Marshal.Copy(new IntPtr(pDIB.ToInt32() + 40), pManagedArray, 0, nSize);

Use instead:
Marshal.Copy(new IntPtr(pDIB.ToInt64() + 40), pManagedArray, 0, nSize);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants