<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
The latest debian build for h5utils seems to work fine now with libpng1.4. However there are problems with libpng1.5. Any plans to upgrading to support libpng1.5?<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: deniz.eren@live.com.au<br>To: pkg-grass-devel@lists.alioth.debian.org; 650488@bugs.debian.org<br>Subject: Regarding Debian Bug report logs - #650488<br>Date: Sun, 17 Jun 2012 00:13:23 +1030<br><br>

<style><!--
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

--></style>
<div dir="ltr">
Hi,<br><br>I've run into crash problems with h5utils program h5topng. I've read the bug report thread #650488 and am using h5utils 1.12.1-2 on Ubuntu 12.04 desktop with kernel 3.2.0-25-generic-pae.<br><br>The crash occurs on line 443 of writepng.c which is:<br><br>     /* if you malloced the palette, free it here */<br>#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4<br>     png_free(png_ptr, palette);<br>     palette = NULL;<br>#else<br>     free(info_ptr->palette);<br>#endif<br><br>The problem is with calling png_free on line 443 because there is no check for whether or not the palette was malloced. In the function writepng where the malloc occurs the value of 'eight_bit' is checked; if 'eight_bit' is true then the palette is malloced.<br><br>Therefore the same 'eight_bit' needs to be checked on line 443 before png_free is called. When I apply this change the crash problem is fixed.<br>The fix should be:<br><br>     /* if you malloced the palette, free it here */<br>#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4<br>     if (eight_bit) {<br>          png_free(png_ptr, palette);<br>     }<br><br>     palette = NULL;<br>#else<br>     free(info_ptr->palette);<br>#endif<br><br>Can you please review my suggestion and let me know what you think?<br><br><br><br>Best regards,<br>Deniz Eren<br><br>                                    </div></div>                                        </div></body>
</html>