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

Several bugfixes #36

Merged
merged 8 commits into from
Apr 25, 2022
Merged

Several bugfixes #36

merged 8 commits into from
Apr 25, 2022

Conversation

hanmertens
Copy link
Contributor

This is a bundle of several unrelated bugfixes, the commit messages describe what each commit should fix. Commit 9974cb0 fixes the "invalid chunk type" error for png input referenced in #5 and #34 but in a different way than the patches in #15 because I had not seen those yet when I wrote it.

Initialize it with spaces instead.
Depending on locale, the formatted date and time may not fit in the
allocated time_string buffer, e.g. when the time zone is also included.
Since the allocation is short-lived anyway, a somewhat larger buffer
size was chosen.
The function g_ascii_strdown allocates a new char array to return, so
the one passed in as argument should be freed afterwards if it isn't used.
The double call to lround with an assignment in the middle was
simplified to a single call to lround as this produces identical results
on gcc, but now clang also produces the same results which it did not do
before.
This is in line with libpng's documentation for taking the low-level API
approach which the rest of the function is doing. Using png_read_png
results in a crash on my machine.
This caused the preserve width option to have no effect, because it
never matched with the misspelled version.
Probably more bounds checks are needed, but this one is surely triggered
because is_valid_dir is called with row and col up to height-1 and
width-1 respectively with dir=EAST in find_centerline_pixels at
src/pxl-outline.c:243 (after commit).
There's an array with a fixed length, its maximum index should be lower
than that length, otherwise a fatal error is now triggered.
@UnsolvedCypher
Copy link

@martweb1 can this be merged?

@martweb1
Copy link

martweb1 commented Aug 15, 2020 via email

@mattkelly
Copy link

Not sure about the other changes, but I'm successfully using this branch to work around the "invalid chunk type" error. Thanks!

Any update on this being merged?

@robertgoacher
Copy link

I'm also having trouble with this 'chunk' error.

It would be great if this fix could be merged now.

@robertgoacher
Copy link

@lemenkov Are you still in charge of this repository?

@UnsolvedCypher
Copy link

I believe @jnweiger is the other member of the repository. If you could take a look and merge this PR that would be great!

@lemenkov
Copy link
Member

Looks good to me!

@lemenkov lemenkov merged commit 154c347 into autotrace:master Apr 25, 2022
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

Successfully merging this pull request may close these issues.

None yet

6 participants