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

Access violation in merge.h in windows release build only #129

Open
jstavats opened this issue Jul 13, 2023 · 1 comment
Open

Access violation in merge.h in windows release build only #129

jstavats opened this issue Jul 13, 2023 · 1 comment

Comments

@jstavats
Copy link

Hi,
I've got some png images here that repeatably crash a windows release build of ECT, but are processed fine by a debug build. They crash at line 83 of merge.h in zopfli at the while statement:

/* The remaining few bytes. */
while (scan != end && *scan == *match) {
scan++; match++;
}

I've been able to see that periodically the variable scan is equal to end+1 at the first call of the GetMatch function, and so the access violation occurs when it goes to access then memory at scan. I changed the above lines to:

while (scan < end && *scan == *match) {
scan++; match++;
}

which seems to make the problem go away, but without knowing what the issue is, I cannot say whether this is a safe patch.

Any thoughts?

Jay

@fhanau
Copy link
Owner

fhanau commented Jul 28, 2023

Sounds like something to be investigated – can you attach an image where the problem occurs?

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