--- src/simple_png_read.c +++ src/simple_png_read.c @@ -92,7 +92,7 @@ return -1; } - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { fprintf(stderr, "simple_png_read: error (internal)\n"); png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); fclose(fp); @@ -226,7 +226,7 @@ return -1; } - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(png_jmpbuf(png_ptr))) { fprintf(stderr, "simple_png_read_header: error\n"); png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); fclose(fp); --- src/simple_png_write.c +++ src/simple_png_write.c @@ -18,6 +18,7 @@ #include #include #include +#include int simple_png_write_rgba( char *filename,