id summary reporter owner description type status priority component version resolution keywords cc game 2670 encode_dxa: Suspect behaviour eriktorbjorn Kirben "{{{#!Markdown Since there have been some recent reports about encode\_dxa claiming PNG files were not as expected on some systems, I looked a bit closer at it, and there's one thing that's puzzling me: We call read\_png\_file\(\) from within a loop. The first time we call it, neither 'image' nor 'palette' are initialized, so they may or may not be NULL. Therefore, if read\_png\_file\(\) fails the first time, we'll either get the ""8-bit 256-color"" warning, or we'll try and free at least one invalid pointer. If read\_png\_file\(\) succeeds, and 'palette' was automatically initialized to an invalid pointer, a new palette will be allocated, and things will work as expected, I guess. But if 'palette' was automatically initialized to NULL, it will not allocate a new palette, and then we'd get that ""8-bit 256-color"" warning. At least, that's what I think would happen. I'm not all that familiar with libpng, and I don't want to experiment with it without discussing it with Kirben... }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#1504440. Ticket imported from: bugs/2670. }}}" defect closed high Tools fixed