--- a/src/libs/tgfclient/img.cpp
+++ b/src/libs/tgfclient/img.cpp
@@ -98,7 +98,7 @@
		return (unsigned char *)NULL;
	}
	
-	if (setjmp(png_ptr->jmpbuf))
+	if (setjmp(png_jmpbuf(png_ptr)))
	{
		/* Free all of the memory associated with the png_ptr and info_ptr */
		png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
@@ -229,7 +229,7 @@
		return -1;
	}
	
-	if (setjmp(png_ptr->jmpbuf)) {    
+	if (setjmp(png_jmpbuf(png_ptr))) {
		png_destroy_write_struct(&png_ptr, &info_ptr);
		fclose(fp);
		return -1;
