aboutsummaryrefslogtreecommitdiff
path: root/multimedia/stills2dv/libpng.patch
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/stills2dv/libpng.patch')
-rw-r--r--multimedia/stills2dv/libpng.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/multimedia/stills2dv/libpng.patch b/multimedia/stills2dv/libpng.patch
new file mode 100644
index 000000000000..98a070f86ec2
--- /dev/null
+++ b/multimedia/stills2dv/libpng.patch
@@ -0,0 +1,57 @@
+--- stills2dv-alpha-0.602/s2d_png.c.orig 2016-02-13 22:37:33.318517038 +0700
++++ stills2dv-alpha-0.602/s2d_png.c 2016-02-13 22:49:22.996228344 +0700
+@@ -75,8 +75,8 @@
+ png_init_io(png_ptr, in);
+ png_set_sig_bytes(png_ptr, 8);
+ png_read_info(png_ptr, info_ptr);
+- width = info_ptr->width;
+- height = info_ptr->height;
++ width = png_get_image_width(png_ptr, info_ptr);;
++ height = png_get_image_height(png_ptr, info_ptr);
+ png_set_interlace_handling(png_ptr);
+ png_read_update_info(png_ptr, info_ptr);
+ if (setjmp(png_jmpbuf(png_ptr)))
+@@ -91,7 +91,7 @@
+ return NULL;
+ }
+ for (y=0; y<height; y++)
+- if((row_pointers[y] = (unsigned char *) malloc(info_ptr->rowbytes))==NULL)
++ if((row_pointers[y] = (unsigned char *) malloc(png_get_rowbytes(png_ptr, info_ptr)))==NULL)
+ {
+ fprintf(stderr, "Out of memory allocating rows for png\n");
+ while(y>1)
+@@ -128,14 +128,14 @@
+ free(img);
+ return NULL;
+ }
+- if(info_ptr->color_type == PNG_COLOR_TYPE_RGB)
++ if(png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB)
+ {
+
+ for (y=0;y<height;y++)
+ {
+ memcpy(&img->data[y*width*3], row_pointers[y], width*3);
+ }
+- }else if (info_ptr->color_type == PNG_COLOR_TYPE_RGBA)
++ }else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGBA)
+ {
+ data=img->data;
+ for (y=0;y<height;y++)
+@@ -149,7 +149,7 @@
+ row++;
+ }
+ }
+- }else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
++ }else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
+ {
+ data=img->data;
+ for (y=0;y<height;y++)
+@@ -162,7 +162,7 @@
+ *(data++)=*(row++);
+ }
+ }
+- }else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ }else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
+ {
+ data=img->data;
+ for (y=0;y<height;y++)