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

Fix for running on x64 #1

Closed
genejo opened this issue Jan 16, 2020 · 1 comment
Closed

Fix for running on x64 #1

genejo opened this issue Jan 16, 2020 · 1 comment

Comments

@genejo
Copy link

genejo commented Jan 16, 2020

Thanks for the neat library!

Tried running after compiling for x64 and it broke. Found a fix - you may want to replace line 320:

var dst = new IntPtr(bmp_data.Scan0.ToInt32() + (stride * y));

with

var dst = IntPtr.Add(bmp_data.Scan0, stride * y);

to avoid manually interfering with pointer arithmetics.

@secile
Copy link
Owner

secile commented Jan 21, 2020

Thank you for your information.
In my PC, your problem is not occur, but I understand what you say.
Under x64, IntPtr value can be larger than 4byte,
therefore Scan0.ToInt32() can be cause overflow exception.

I'll fix this problem future release. Thank you.

@secile secile closed this as completed Jan 21, 2020
@secile secile reopened this Jan 21, 2020
secile added a commit that referenced this issue Jan 23, 2020
* Fix overflow exception problem in x64. (issue #1)
* Fix problem that can not use if no IAMVideoProcAmp Interface.
@secile secile closed this as completed Jan 23, 2020
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

2 participants