]> git.pld-linux.org Git - packages/fontforge.git/blob - 902_fix_optipng_reads.diff
e0f000630fe1013895902f9e724e18664526c507
[packages/fontforge.git] / 902_fix_optipng_reads.diff
1 Description: If trans_alpha is NULL (likely due to optimized png), don't crash
2 Author: Michael Terry <michael.terry@canonical.com>
3 Forwarded: yes
4 Bug-Ubuntu: https://launchpad.net/bugs/805752
5 Bug: http://bugs.debian.org/646619
6
7 Index: fontforge-0.0.20110222/gutils/gimagereadpng.c
8 ===================================================================
9 --- fontforge-0.0.20110222.orig/gutils/gimagereadpng.c  2011-10-25 14:17:10.856004364 -0400
10 +++ fontforge-0.0.20110222/gutils/gimagereadpng.c       2011-10-25 14:17:14.640004404 -0400
11 @@ -282,9 +282,9 @@
12                     (trans_color->green>>8),
13                     (trans_color->blue>>8));
14          else if ( base->image_type == it_mono )
15 -           base->trans = trans_alpha[0];
16 +           base->trans = trans_alpha ? trans_alpha[0] : 0;
17         else
18 -           base->clut->trans_index = base->trans = trans_alpha[0];
19 +           base->clut->trans_index = base->trans = trans_alpha ? trans_alpha[0] : 0;
20      }
21  
22      row_pointers = galloc(_png_get_image_height(png_ptr,info_ptr)*sizeof(png_bytep));
This page took 0.055123 seconds and 2 git commands to generate.