Problem with libpng on mac OSX.6

View: New views
3 Messages — Rating Filter:   Alert me  

Problem with libpng on mac OSX.6

by Arnaud BOEGLIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Hi,
>
> I work on a project which uses libpng. I always worked with the  
> version
> 1.2.39. I recently installed mac OS X.6. So I recompiled libpng, I  
> modified
> my project's configuration, but I've got an error while loading the  
> png
> file. The function which crashes is : png_get_IHDR. The output is :  
> "libpng
> error: Invalid image width".
>
> I tried with a lot of different images, it's the same for all.
>
> If you came light me ..
>
> Regards,
> Arnaud BOEGLIN.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: Problem with libpng on mac OSX.6

by John Bowler-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Arnaud BOEGLIN [mailto:a.boeglin67@...]
>The function which crashes is : png_get_IHDR. The output is :  
> "libpng error: Invalid image width".

I think that means 'width' is 0, because the other case (width > 0x7fffffff)
has already been excluded.

There are two possibilities, one, by far the most likely, is that something
in your code is overwriting the "info_ptr" memory to zero out the width
field, or maybe much of the structure (but not bit_depth).  Zeroing most
fields will produce values that pass the initial checks in png_get_IDHR but
fail at 'width'.

Look at the value of width in a debugger (or add a printf to libpng) - is it
0?  If not, what is it (and how did it get that way ;-)  If it is zero take
a look at the other fields, like color_type - is that 0 too.  Should it be?
(Try with an image where it shouldn't be zero.)

The second possibility, really unlikely, is that you have compiled with
PNG_READ_BIG_ENDIAN_SUPPORTED on a platform that doesn't support it and this
has resulted in the info_ptr->width field ending up '0' even though the
bytes in the header didn't say 0.

This will happen if you set that option on a big-endian ARM system (for
example) where the unaligned data access exception handling has been
switched off (the default, IRC.)

BTW, "PNG_READ_BIG_ENDIAN_SUPPORTED" should *never* be switched on for ARM -
ARM support for unaligned data access is *much* slower than the byte-by-byte
code in libpng.

John Bowler <jbowler@...>



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Re: Problem with libpng on mac OSX.6

by Glenn Randers-Pehrson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Sep 23, 2009 at 7:39 PM, Arnaud BOEGLIN <a.boeglin67@...> wrote:

>> Hi,
>>
>> I work on a project which uses libpng. I always worked with the
>> version
>> 1.2.39. I recently installed mac OS X.6. So I recompiled libpng, I
>> modified
>> my project's configuration, but I've got an error while loading the
>> png
>> file. The function which crashes is : png_get_IHDR. The output is :
>> "libpng
>> error: Invalid image width".
>>
>> I tried with a lot of different images, it's the same for all.

Please try building your application with libpng-1.4.0beta82 and
see if the error reporting is more useful.

Glenn

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement