Created
June 16, 2012 18:39
-
-
Save springmeyer/2942214 to your computer and use it in GitHub Desktop.
fix png compile error with mapnik head (post https://github.com/mapnik/mapnik/commit/cd7ad3e15eed5b9b582c2b92175a68b77c1f5547)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/png_reader.cpp b/src/png_reader.cpp | |
index 8b993c7..15a8fbd 100644 | |
--- a/src/png_reader.cpp | |
+++ b/src/png_reader.cpp | |
@@ -119,7 +119,8 @@ void png_reader::init() | |
throw image_reader_exception("failed to create info_ptr"); | |
} | |
- if (setjmp(png_jmpbuf(png_ptr))) | |
+ jmp_buf* jmp_context = (jmp_buf*) png_get_error_ptr(png_ptr); | |
+ if (jmp_context) | |
{ | |
png_destroy_read_struct(&png_ptr,0,0); | |
fclose(fp); | |
@@ -175,7 +176,8 @@ void png_reader::read(unsigned x0, unsigned y0,image_data_32& image) | |
throw image_reader_exception("failed to create info_ptr"); | |
} | |
- if (setjmp(png_jmpbuf(png_ptr))) | |
+ jmp_buf* jmp_context = (jmp_buf*) png_get_error_ptr(png_ptr); | |
+ if (jmp_context) | |
{ | |
png_destroy_read_struct(&png_ptr,0,0); | |
fclose(fp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment