1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
Description: Upstream changes introduced in version 3.0.1-2.1
This patch has been created by dpkg-source during the package build.
Here's the last changelog entry, hopefully it gives details on why
those changes were made:
.
flam3 (3.0.1-2.1) unstable; urgency=low
.
* Non-maintainer upload.
* libpng transition.
.
The person named in the Author field signed this changelog entry.
Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>
--- flam3-3.0.1.orig/src/png.c
+++ flam3-3.0.1/src/png.c
@@ -125,6 +125,7 @@ unsigned char *read_png(FILE *ifp, int *
png_byte **png_image = NULL;
unsigned int linesize, x, y;
unsigned char *p, *q;
+ int bit_depth, color_type;
if (fread (sig_buf, 1, SIG_CHECK_SIZE, ifp) != SIG_CHECK_SIZE) {
fprintf (stderr, "input file empty or too short\n");
@@ -141,8 +142,9 @@ unsigned char *read_png(FILE *ifp, int *
return 0;
}
if (setjmp(png_jmpbuf(png_ptr))) {
+ int height_temp = png_get_image_height(png_ptr, info_ptr);
if (png_image) {
- for (y = 0 ; y < info_ptr->height ; y++)
+ for (y = 0 ; y < height_temp ; y++)
free (png_image[y]);
free (png_image);
}
@@ -161,19 +163,20 @@ unsigned char *read_png(FILE *ifp, int *
png_set_sig_bytes (png_ptr, SIG_CHECK_SIZE);
png_read_info (png_ptr, info_ptr);
- if (8 != info_ptr->bit_depth) {
+ bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+ if (8 != bit_depth) {
fprintf(stderr, "bit depth type must be 8, not %d.\n",
- info_ptr->bit_depth);
+ bit_depth);
return 0;
}
- *width = info_ptr->width;
- *height = info_ptr->height;
+ *width = png_get_image_width(png_ptr, info_ptr);
+ linesize = *height = png_get_image_height(png_ptr, info_ptr);
p = q = malloc(4 * *width * *height);
- png_image = (png_byte **)malloc (info_ptr->height * sizeof (png_byte*));
+ png_image = (png_byte **)malloc (*height * sizeof (png_byte*));
- linesize = info_ptr->width;
- switch (info_ptr->color_type) {
+ color_type = png_get_color_type(png_ptr, info_ptr);
+ switch (color_type) {
case PNG_COLOR_TYPE_RGB:
linesize *= 3;
break;
@@ -182,21 +185,21 @@ unsigned char *read_png(FILE *ifp, int *
break;
default:
fprintf(stderr, "color type must be RGB or RGBA not %d.\n",
- info_ptr->color_type);
+ color_type);
return 0;
}
- for (y = 0 ; y < info_ptr->height ; y++) {
+ for (y = 0 ; y < *height ; y++) {
png_image[y] = malloc (linesize);
}
png_read_image (png_ptr, png_image);
png_read_end (png_ptr, info_ptr);
- for (y = 0 ; y < info_ptr->height ; y++) {
+ for (y = 0 ; y < *height ; y++) {
unsigned char *s = png_image[y];
- for (x = 0 ; x < info_ptr->width ; x++) {
+ for (x = 0 ; x < *width ; x++) {
- switch (info_ptr->color_type) {
+ switch (color_type) {
case PNG_COLOR_TYPE_RGB:
p[0] = s[0];
p[1] = s[1];
@@ -217,7 +220,7 @@ unsigned char *read_png(FILE *ifp, int *
}
}
- for (y = 0 ; y < info_ptr->height ; y++)
+ for (y = 0 ; y < *height ; y++)
free (png_image[y]);
free (png_image);
png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
|