﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	phab_field
6436	Engine should handle malformed DDS more gracefully	Andy Alt		"Itms asked me to report this:

In [https://github.com/0ad-matters/community-maps-2/releases/tag/v0.25.10 version 0.25.10 of community maps 2], a segfault would happen if selecting the Povorotnaya random map.

I had added the [https://wildfiregames.com/forum/topic/63618-random-povorotnaya/ png provided by the author for the map preview].

Before the release, I didn't have any problems when testing with git. But after I created the pyromod file and issued the release, someone opened a [https://github.com/0ad-matters/community-maps-2/issues/30 ticket which reported a segfault].

{{{
Function call failed: return value was -120102 (Invalid/unsupported texture format)
Location: tex_dds.cpp:562 (decode_sd)

Call stack:

(0x555a5ffc0c26) pyrogenesis(+0x611c26) [0x555a5ffc0c26]
(0x555a5ff5fb50) pyrogenesis(+0x5b0b50) [0x555a5ff5fb50]
(0x555a5ff6168a) pyrogenesis(+0x5b268a) [0x555a5ff6168a]
(0x555a5ff5fd87) pyrogenesis(+0x5b0d87) [0x555a5ff5fd87]
(0x555a5ffe2c95) pyrogenesis(+0x633c95) [0x555a5ffe2c95]
(0x555a5ffe1994) pyrogenesis(+0x632994) [0x555a5ffe1994]
(0x555a5ffb53c1) pyrogenesis(+0x6063c1) [0x555a5ffb53c1]
(0x555a5ffb8013) pyrogenesis(+0x609013) [0x555a5ffb8013]
(0x555a5fdab44a) pyrogenesis(+0x3fc44a) [0x555a5fdab44a]
(0x555a5fdabc86) pyrogenesis(+0x3fcc86) [0x555a5fdabc86]
(0x555a5fda5978) pyrogenesis(+0x3f6978) [0x555a5fda5978]
(0x555a5ff4c4a1) pyrogenesis(+0x59d4a1) [0x555a5ff4c4a1]
(0x555a5fed5c70) pyrogenesis(+0x526c70) [0x555a5fed5c70]
(0x555a5ff33d74) pyrogenesis(+0x584d74) [0x555a5ff33d74]
(0x555a5fec34ef) pyrogenesis(+0x5144ef) [0x555a5fec34ef]
(0x555a5fc7f198) pyrogenesis(+0x2d0198) [0x555a5fc7f198]

errno = 11 (Try again later)
OS error = ?

tex_dds.cpp(562): Function call failed: return value was -120102 (Invalid/unsupported texture format)
zsh: segmentation fault (core dumped) pyrogenesis community-maps-2-0.25.10.pyromod
}}}


I made a new png map preview and created a pyromod file for the new release (v0.25.11) and the issue is fixed.

The [https://github.com/0ad-matters/community-maps-2/raw/v0.25.10/art/textures/ui/session/icons/mappreview/povorotnaya.png original png] was not designed properly for a map preview file, and while testing the git version, it did not appear properly in the upper-right corner of the game setup menu, but did not cause any crash.
"	defect	new	Should Have	Alpha 26	Core engine				
