Description: If trans_alpha is NULL (likely due to optimized png), don't crash
Author: Michael Terry <michael.terry@canonical.com>
Forwarded: yes
Bug-Ubuntu: https://launchpad.net/bugs/805752
Bug: http://bugs.debian.org/646619

Index: fontforge-0.0.20110222/gutils/gimagereadpng.c
===================================================================
--- fontforge-0.0.20110222.orig/gutils/gimagereadpng.c	2011-10-25 14:17:10.856004364 -0400
+++ fontforge-0.0.20110222/gutils/gimagereadpng.c	2011-10-25 14:17:14.640004404 -0400
@@ -282,9 +282,9 @@
 		    (trans_color->green>>8),
 		    (trans_color->blue>>8));
         else if ( base->image_type == it_mono )
-	    base->trans = trans_alpha[0];
+	    base->trans = trans_alpha ? trans_alpha[0] : 0;
 	else
-	    base->clut->trans_index = base->trans = trans_alpha[0];
+	    base->clut->trans_index = base->trans = trans_alpha ? trans_alpha[0] : 0;
     }
 
     row_pointers = galloc(_png_get_image_height(png_ptr,info_ptr)*sizeof(png_bytep));
