png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf));
png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr){#ifdef PNG_SETJMP_SUPPORTED   jmp_buf tmp_jmp;#endif   png_error_ptr error_fn;   png_error_ptr warning_fn;   png_voidp error_ptr;#ifdef PNG_USER_MEM_SUPPORTED   png_free_ptr free_fn;#endif   png_debug(1, "in png_read_destroy\n");   if (info_ptr != NULL)      png_info_destroy(png_ptr, info_ptr);   if (end_info_ptr != NULL)      png_info_destroy(png_ptr, end_info_ptr);   png_free(png_ptr, png_ptr->zbuf);   png_free(png_ptr, png_ptr->big_row_buf);   png_free(png_ptr, png_ptr->prev_row);#if defined(PNG_READ_DITHER_SUPPORTED)   png_free(png_ptr, png_ptr->palette_lookup);   png_free(png_ptr, png_ptr->dither_index);#endif#if defined(PNG_READ_GAMMA_SUPPORTED)   png_free(png_ptr, png_ptr->gamma_table);#endif#if defined(PNG_READ_BACKGROUND_SUPPORTED)   png_free(png_ptr, png_ptr->gamma_from_1);   png_free(png_ptr, png_ptr->gamma_to_1);#endif#ifdef PNG_FREE_ME_SUPPORTED   if (png_ptr->free_me & PNG_FREE_PLTE)      png_zfree(png_ptr, png_ptr->palette);   png_ptr->free_me &= ~PNG_FREE_PLTE;#else   if (png_ptr->flags & PNG_FLAG_FREE_PLTE)      png_zfree(png_ptr, png_ptr->palette);   png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;#endif#if defined(PNG_tRNS_SUPPORTED) || \    defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)#ifdef PNG_FREE_ME_SUPPORTED   if (png_ptr->free_me & PNG_FREE_TRNS)      png_free(png_ptr, png_ptr->trans);   png_ptr->free_me &= ~PNG_FREE_TRNS;#else   if (png_ptr->flags & PNG_FLAG_FREE_TRNS)      png_free(png_ptr, png_ptr->trans);   png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;#endif#endif#if defined(PNG_READ_hIST_SUPPORTED)#ifdef PNG_FREE_ME_SUPPORTED   if (png_ptr->free_me & PNG_FREE_HIST)      png_free(png_ptr, png_ptr->hist);   png_ptr->free_me &= ~PNG_FREE_HIST;#else   if (png_ptr->flags & PNG_FLAG_FREE_HIST)      png_free(png_ptr, png_ptr->hist);   png_ptr->flags &= ~PNG_FLAG_FREE_HIST;#endif#endif#if defined(PNG_READ_GAMMA_SUPPORTED)   if (png_ptr->gamma_16_table != NULL)   {      int i;      int istop = (1 << (8 - png_ptr->gamma_shift));      for (i = 0; i < istop; i++)      {         png_free(png_ptr, png_ptr->gamma_16_table[i]);      }   png_free(png_ptr, png_ptr->gamma_16_table);   }#if defined(PNG_READ_BACKGROUND_SUPPORTED)   if (png_ptr->gamma_16_from_1 != NULL)   {      int i;      int istop = (1 << (8 - png_ptr->gamma_shift));      for (i = 0; i < istop; i++)      {         png_free(png_ptr, png_ptr->gamma_16_from_1[i]);      }   png_free(png_ptr, png_ptr->gamma_16_from_1);   }   if (png_ptr->gamma_16_to_1 != NULL)   {      int i;      int istop = (1 << (8 - png_ptr->gamma_shift));      for (i = 0; i < istop; i++)      {         png_free(png_ptr, png_ptr->gamma_16_to_1[i]);      }   png_free(png_ptr, png_ptr->gamma_16_to_1);   }#endif#endif#if defined(PNG_TIME_RFC1123_SUPPORTED)   png_free(png_ptr, png_ptr->time_buffer);#endif   inflateEnd(&png_ptr->zstream);#ifdef PNG_PROGRESSIVE_READ_SUPPORTED   png_free(png_ptr, png_ptr->save_buffer);#endif#ifdef PNG_PROGRESSIVE_READ_SUPPORTED#ifdef PNG_TEXT_SUPPORTED   png_free(png_ptr, png_ptr->current_text);#endif /* PNG_TEXT_SUPPORTED */#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */   /* Save the important info out of the png_struct, in case it is    * being used again.    */#ifdef PNG_SETJMP_SUPPORTED   png_memcpy(tmp_jmp, png_ptr->jmpbuf, sizeof (jmp_buf));#endif   error_fn = png_ptr->error_fn;   warning_fn = png_ptr->warning_fn;   error_ptr = png_ptr->error_ptr;#ifdef PNG_USER_MEM_SUPPORTED   free_fn = png_ptr->free_fn;#endif   png_memset(png_ptr, 0, sizeof (png_struct));   png_ptr->error_fn = error_fn;   png_ptr->warning_fn = warning_fn;   png_ptr->error_ptr = error_ptr;#ifdef PNG_USER_MEM_SUPPORTED   png_ptr->free_fn = free_fn;#endif#ifdef PNG_SETJMP_SUPPORTED   png_memcpy(png_ptr->jmpbuf, tmp_jmp, sizeof (jmp_buf));#endif}