Skin Layers 3D (Fabric/Forge)

Skin Layers 3D (Fabric/Forge)

57M Downloads

[Bug] Crash when calling NativeImage.getLuminanceOrAlpha due to null 'pixels' pointer

Closed this issue ยท 1 comments

commented

Game crashes with an EXCEPTION_ACCESS_VIOLATION in the method NativeImage.getLuminanceOrAlpha(int x, int y).
It seems that NativeImage.pixels is null (0x0) when the method is called, leading to a native crash.
The crash is triggered while using the mod skinlayers (SolidPixelWrapper / getOnTextureUV).

Stack trace (abridged):

Problematic frame:
J com.mojang.blaze3d.platform.NativeImage.getLuminanceOrAlpha(II)B
[pixels = 0x0]
...
Class: dev.tr7zw.skinlayers.versionless.util.wrapper.SolidPixelWrapper
Steps to reproduce:

Possibly occurs when the game is AFK, resourcepack reload, or skin texture is released

Mod version: 1.8.0 - 1.21.5
Minecraft version: 1.21.5
Java: Zulu JDK 21.0.7 (ZGC enabled)

Suggested fix:
Please ensure pixels != 0 before accessing it in getLuminanceOrAlpha, or guard the upstream call to avoid using an unloaded image.

My logs:

hs_err_pid31452.log

latest.log
modlist.txt
debug.log

commented

It unintentionally broke in 1.21.2+, fixed.