EmulatorArchive / genplus-gx

Automatically exported from code.google.com/p/genplus-gx
Other
1 stars 0 forks source link

Incompatibility with libpng 1.4.x #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Grab latest revision of genplus-gx
2. Grab latest version of devkitppc and libpng 1.4.0
3. Attempt to compile.

What is the expected output? What do you see instead?
I expected a binary. I got errors from the compiler telling me 
png_check_sig doesn't exist

What version of the emulator are you using?
r431

Please provide any additional information below (video settings, console
region,...)
It seems as libpng has increased to version 1.4.0 from 1.2.40, the 
png_check_sig function has been eliminated. The new (comparable) function 
seems to be png_sig_cmp according to searching on forums. Yet when I try 
to replace the function 

if (!png_check_sig (magic, 8))

with

if (!png_sig_cmp (magic, 1, 8))

in gx_video.c, it will compile but once I go to load a game it will kick 
me out to the loader if I have my hand pointer over a game that I have a 
screenshot for.

If anyone know coding a little better I think this could be an easy change.

_J

Original issue reported on code.google.com by jora...@gmail.com on 23 Mar 2010 at 7:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok, it should be:

if (!png_sig_cmp (magic, 0, 8))

The first parameter is a pointer to the array to look at, the 2nd is the byte 
index
in the array where to start to look at and the last one is the number of bytes 
to
look at. Since the 'magic' array is 8 bytes wide, if you set the start index to 
1,
the last byte will be read outside the array memory allocated area, which is
generally not good.

Original comment by ekeeke31@gmail.com on 24 Mar 2010 at 9:44

GoogleCodeExporter commented 9 years ago
Thank you so much for this, I have been pulling my hair out today trying to 
figure
this out! Tested and working.

Original comment by joelwhyb...@googlemail.com on 11 Apr 2010 at 6:33

GoogleCodeExporter commented 9 years ago

Original comment by ekeeke31@gmail.com on 13 Apr 2010 at 12:21