View Issue Details

IDProjectCategoryView StatusLast Update
0002743FSSCPgraphicspublic2012-12-04 16:50
ReporterThe_E Assigned ToValathil  
PrioritylowSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.16 
Target Version3.7.2 
Summary0002743: 16-bit PNG textures cause crash
DescriptionIn TAP, we're using converted HW2 backgrounds as skyspheres. While testing this, pecenipicek found that a sufficiently large png (4096*2048 in this case) will crash the engine while trying to load the image. Test skysphere can be found here: http://blueplanet.fsmods.net/E/TAP/data.7z ; try adding it as a background and watch the explosion.

Based on my (admittedly cursory) look at the code in question, I _think_ the culprit is found in png_read_bitmap, specifically lines 196/197 of pngutils.cpp. Here, the bpp value is changed, which isn't much of an issue if it gets changed downwards (as it is assumed to be 32 prior to the call to png_read_bitmap, and the image_data pointer allocated accordingly), but in this case, it was changed upwards, causing the memcpy in line 202 hitting bad memory after some time.

I should also add that this is specifically related to png, the skybox works fine when used with tga textures, hence the low priority on this bug.
TagsNo tags attached.

Activities

pecenipicek

2012-12-03 10:52

reporter   ~0014270

I am probably an idiot on this front, the texture i tried feeding the game is a 16-bit PNG instead of an 8-bit one. I know i hit a similar snag earlier while trying to use a png for an effect as well...

pecenipicek

2012-12-03 10:57

reporter   ~0014271

I am going to have to confirm that this is an issue with 16-bit png's, NOT the resolution itself, as i got it to load without problems when i manually switched the png to 8-bit.

MjnMixael

2012-12-04 14:36

manager   ~0014285

Can you attach a 16-bit png for us to test with?

pecenipicek

2012-12-04 14:52

reporter   ~0014286

Its in the zip, maps folder, m15.png

The_E

2012-12-04 15:26

administrator   ~0014287

I tried to attach it, but the resulting 7z was too large. So I linked to it in the description.

Valathil

2012-12-04 16:50

developer   ~0014289

Fix committed to Trunk @ 9393

Issue History

Date Modified Username Field Change
2012-11-30 22:26 The_E New Issue
2012-11-30 22:26 The_E File Added: asttest.fs2
2012-11-30 22:27 The_E File Deleted: asttest.fs2
2012-12-03 10:52 pecenipicek Note Added: 0014270
2012-12-03 10:57 pecenipicek Note Added: 0014271
2012-12-04 08:28 niffiwan Summary Large PNG textures cause crash => 16-bit PNG textures cause crash
2012-12-04 14:36 MjnMixael Note Added: 0014285
2012-12-04 14:52 pecenipicek Note Added: 0014286
2012-12-04 15:26 The_E Note Added: 0014287
2012-12-04 16:49 Valathil Assigned To => Valathil
2012-12-04 16:49 Valathil Status new => assigned
2012-12-04 16:50 Valathil Note Added: 0014289
2012-12-04 16:50 Valathil Status assigned => resolved
2012-12-04 16:50 Valathil Resolution open => fixed