patch-gif2png_c 847 B

1234567891011121314151617181920212223
  1. --- gif2png.c.orig Mon Jul 13 03:26:18 2015
  2. +++ gif2png.c Wed Apr 27 19:51:20 2016
  3. @@ -137,6 +137,19 @@ static int writefile(struct GIFelement *s, struct GIFe
  4. png_text software;
  5. png_text comment;
  6. + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
  7. + if (png_ptr == NULL) {
  8. + fprintf(stderr, "gif2png: fatal error, out of memory\n");
  9. + fprintf(stderr, "gif2png: exiting ungracefully\n");
  10. + exit(1);
  11. + }
  12. + info_ptr = png_create_info_struct(png_ptr);
  13. + if (info_ptr == NULL) {
  14. + fprintf(stderr, "gif2png: fatal error, out of memory\n");
  15. + fprintf(stderr, "gif2png: exiting ungracefully\n");
  16. + exit(1);
  17. + }
  18. +
  19. /* these volatile declarations prevent gcc warnings ("variable might be
  20. * clobbered by `longjmp' or `vfork'") */
  21. volatile bool gray = true;