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

png-1.5 fixes #43

Closed
timfel opened this issue Nov 19, 2015 · 6 comments
Closed

png-1.5 fixes #43

timfel opened this issue Nov 19, 2015 · 6 comments

Comments

@timfel
Copy link
Member

timfel commented Nov 19, 2015

In the latest releases, 1.5 and newer, the png library disabled direct
access to its structure members. One is supposed to use the accessor
functions now.
The attached patch (against 2.1, but seems to be still needed looking at the online repository a few minutes ago) fixes the issue.


Imported from Launchpad using lp2gh.

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by tk-giga)

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by pali)
And why is this patch needed?

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by tk-giga)
As I said, png-1.5 now forbids access to internal struct members.
Compilerwise, without the patch, it looks like this:
src/video/obj/../png.c: In function 'LoadGraphicPNG':
src/video/obj/../png.c:136: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:215: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:219: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:227: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:273: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:274: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:275: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:276: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:277: error: dereferencing pointer to incomplete type
src/video/obj/../png.c:278: error: dereferencing pointer to incomplete type
src/video/obj/../png.c: In function 'SaveScreenshotPNG':
src/video/obj/../png.c:334: error: dereferencing pointer to incomplete type

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by pali)
Is this bug same as this https://bugs.launchpad.net/stratagus/+bug/816575 ?

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by tk-giga)
Yes, this patch will fix the issue reported in https://bugs.launchpad.net/stratagus/+bug/816575
Sorry that I overlooked that bug report.

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by pali)
Your patch file was not possible to apply, because it was for old version of stratagus. It was against file png.c, but in stratagus is now png.cpp (and has other structure). So I modified file png.cpp manually.

Chnages is in this commit: http://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/7993
Check if all png erros is fixed.

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

No branches or pull requests

1 participant