Open Alex-gnzl opened 5 days ago
To be clear, you're building from the current gdsdecomp master with Godot @ the commit listed in the readme, correct?
Yes, master with the particular commit -- it also seems to happen with the release and (at the time of writing) latest Actions build.
Ah, heck, I thought this was fixed in the godot engine. Lemme guess, that particular texture is 1x1 pixels, right?
I initially thought so too after searching for a bit, but The readme commit is after that fix: (modules/bcdec/image_decompress_bcdec.cpp:98)
// Compressed images' dimensions should be padded to the upper multiple of 4.
// If they aren't, they need to be realigned (the actual data is correctly padded though).
if (width % 4 != 0 || height % 4 != 0) {
int new_width = width + (4 - (width % 4));
int new_height = height + (4 - (height % 4));
print_verbose(vformat("Compressed image's dimensions are not multiples of 4 (%dx%d), aligning to (%dx%d)", width, height, new_width, new_height));
width = new_width;
height = new_height;
}
The stack trace suggests it's 384x128:
#13 Image::initialize_data (this=0x55555d883450, p_width=384, p_height=128, p_use_mipmaps=true, p_format=Image::FORMAT_RGBA8, p_data=...) at core/io/image.cpp:2310
2310 data = p_data;
Which checks out because it's a padded up 381x127 (quickly tossed into the Editor to check):
I had a random thought and cleared mipmaps in image_decompress_bcdec
before it gets to them and that made it work!
Something's wrong with the mipmaps -- could it be related to the <4 width/height thing; or did something change in Godot (I believe the game uses 4.2.1? not sure)?
This is definitely a bug in Godot. I would recommend filing an issue that cross-references https://github.com/godotengine/godot/issues/97862 and https://github.com/godotengine/godot/pull/97873.
Protip: mention that it causes a heap buffer overflow in the title. That always gets their attention.
How do I do this? Clear mipmaps, I mean.
I got my hands on Psychopomp Gold and attempted to recreate this to no avail. I think I might have fixed it on the latest PR? Could you try the artifacts here and see if you still have the problem? https://github.com/bruvzg/gdsdecomp/actions/runs/11611147300?pr=208
System information
Arch Linux, 6.11
Issue description
A certain asset (assets?) in Psychopomp Gold causes the engine to abort
GDB trace from own build:
(First?) asset that causes this:
res://Sprites/Items/ParagonKeyAnim.png
Steps to reproduce
Try to recover
Psychopomp Gold.exe
using either the Windows or Linux version of gdsdecompRecovery log
N/A
Minimal reproduction project
https://store.steampowered.com/app/3243190/Psychopomp_GOLD/
I wish I could provide an example texture that causes this, but I'm not sure what settings result in this happening.