Dj_Dexter

gthumb-2.10.11-thumb-cache-libpng15.patch

Oct 18th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.27 KB | None | 0 0
  1. --- libgthumb/thumb-cache.c.orig    2009-02-24 07:18:16.000000000 -0300
  2. +++ libgthumb/thumb-cache.c 2011-10-16 23:30:58.001840332 -0300
  3. @@ -245,8 +245,12 @@
  4.                  "Fatal error in PNG image file: %s",
  5.                  error_msg);
  6.     }
  7. -
  8. -   longjmp (png_save_ptr->jmpbuf, 1);
  9. +        // if for libpng15
  10. +        #if (PNG_LIBPNG_VER < 10500)
  11. +         longjmp (png_save_ptr->jmpbuf, 1);
  12. +        #else
  13. +         png_longjmp (png_save_ptr, 1);
  14. +        #endif
  15.  }
  16.  
  17.  
  18. @@ -294,13 +298,23 @@
  19.  
  20.     info_ptr = png_create_info_struct (png_ptr);
  21.     if (info_ptr == NULL) {
  22. -       png_destroy_read_struct (&png_ptr, NULL, NULL);
  23. +        // if for libpng15
  24. +        #if (PNG_LIBPNG_VER < 10500)
  25. +          png_destroy_read_struct (&png_ptr, NULL, NULL);
  26. +        #else
  27. +          png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
  28. +        #endif          
  29.         fclose (f);
  30.         return NULL;
  31.     }
  32.  
  33. -   if (setjmp (png_ptr->jmpbuf)) {
  34. -       png_destroy_read_struct (&png_ptr, NULL, NULL);
  35. +   if (setjmp(png_jmpbuf(png_ptr))) {
  36. +        // if for libpng15
  37. +        #if (PNG_LIBPNG_VER < 10500)
  38. +          png_destroy_read_struct (&png_ptr, NULL, NULL);
  39. +        #else
  40. +          png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
  41. +        #endif          
  42.         fclose (f);
  43.         return NULL;
  44.     }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment