diff --git a/src/driver/pictureviewer/png.cpp b/src/driver/pictureviewer/png.cpp index 992158ca0..1abcf9bf1 100644 --- a/src/driver/pictureviewer/png.cpp +++ b/src/driver/pictureviewer/png.cpp @@ -52,7 +52,11 @@ int fh_png_load(const char *name,unsigned char **buffer,int* /*xp*/,int* /*yp*/) return(FH_ERROR_FORMAT); } - if(setjmp(png_ptr->jmpbuf)) +#if (PNG_LIBPNG_VER < 10500) + if (setjmp(png_ptr->jmpbuf)) +#else + if (setjmp(png_jmpbuf(png_ptr))) +#endif { png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); fclose(fh); @@ -145,7 +149,11 @@ int fh_png_getsize(const char *name,int *x,int *y, int /*wanted_width*/, int /*w return(FH_ERROR_FORMAT); } - if(setjmp(png_ptr->jmpbuf)) +#if (PNG_LIBPNG_VER < 10500) + if (setjmp(png_ptr->jmpbuf)) +#else + if (setjmp(png_jmpbuf(png_ptr))) +#endif { png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); fclose(fh); diff --git a/src/lcddisplay/lcddisplay.cpp b/src/lcddisplay/lcddisplay.cpp index 6d31cf27c..2144fdee1 100644 --- a/src/lcddisplay/lcddisplay.cpp +++ b/src/lcddisplay/lcddisplay.cpp @@ -454,7 +454,11 @@ bool CLCDDisplay::load_png(const char * const filename) png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); else { +#if (PNG_LIBPNG_VER < 10500) if (!(setjmp(png_ptr->jmpbuf))) +#else + if (!setjmp(png_jmpbuf(png_ptr))) +#endif { png_init_io(png_ptr,fh);