Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > f8614d88311867b7f978e9301d3e9765 > files > 3

xmedcon-0.10.7-9.fc16.src.rpm

--- xmedcon-0.10.7.orig/source/m-png.c  2010-08-28 19:44:23.000000000 -0400
+++ xmedcon-0.10.7.orig/source/m-png.c  2012-07-26 19:23:14.569230330 -0400
@@ -65,7 +65,7 @@ 
 
   if (!png_ptr) return; 
 
-  longjmp(png_ptr->jmpbuf, 1);
+  longjmp(png_jmpbuf(png_ptr), 1);
 }
 
 static void MdcPngWarn(png_structp png_ptr, png_const_charp warning_msg)
@@ -98,6 +98,8 @@ 
   png_uint_32 width, height, rowbytes;
   png_colorp palette;
   png_bytepp row_pointers;
+  png_textp text_ptr;
+  int num_text;
   Uint32 i, commentsize;
   int bit_depth, color_type, transform, num_palette;
   Uint8 *imgRGB, *pbuf;
@@ -161,21 +163,22 @@ 
   }
 
   /* get comment */
-  if(info_ptr->num_text > 0) {
+  if(png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) &&
+     num_text > 0) {
     commentsize = 1;
 
-    for(i = 0; i < info_ptr->num_text; i++)
-      commentsize += strlen(info_ptr->text[i].key) + 1 +
-                     info_ptr->text[i].text_length + 2;
+    for(i = 0; i < num_text; i++)
+      commentsize += strlen(text_ptr[i].key) + 1 +
+                     text_ptr[i].text_length + 2;
     
     if ((fi->comment = malloc(commentsize)) == NULL) {
       MdcPngWarn(png_ptr,"PNG  Can't malloc comment string");
     }else{ 
       fi->comment[0] = '\0';
-      for (i = 0; i < info_ptr->num_text; i++) {
-        strcat(fi->comment, info_ptr->text[i].key);
+      for (i = 0; i < num_text; i++) {
+        strcat(fi->comment, text_ptr[i].key);
         strcat(fi->comment, "::");
-        strcat(fi->comment, info_ptr->text[i].text);
+        strcat(fi->comment, text_ptr[i].text);
         strcat(fi->comment, "\n");
       }
     }