--- readpng.org.c	2011-07-03 13:14:00.000000000 -0500
+++ readpng.c	2011-07-06 07:15:49.000000000 -0500
@@ -182,6 +182,10 @@
 	if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
 		biSrc.bmiHeader.biBitCount = 32;
 		biSrc.bmiHeader.biSizeImage = width*height*4;
+    if (!pMask) {
+	    bi.bmiHeader.biBitCount = 32;
+	    bi.bmiHeader.biSizeImage = width*height*4;
+    }
 	} else {
 		biSrc.bmiHeader.biBitCount = 24;
 		biSrc.bmiHeader.biSizeImage = width*height*3;
