[Linux] Some PNG textures cause segfaults

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Some PNG textures cause segfaults

Post by Graf Zahl »

grAb is only looked at in the constructor. Once the values are known there is no need to read them again. And for texture creation they are simply not needed.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Linux] Some PNG textures cause segfaults

Post by Edward-san »

Hmm, before that weird len, in the previous loop, when 'lump' has:

'Length = 2853, StartPos = 351, FilePos = 412',

'len' is 6 and 'id' matches the tRNS chunk, then inside the switch, ColorType is 2, making the condition (ColorType == 3) false, so the code break the switch without doing any seek. Could it be the problem?
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Linux] Some PNG textures cause segfaults

Post by Edward-san »

Aha, if I add 'else lump->Seek (len, SEEK_CUR);' after the if (ColorType == 3) block, the crash doesn't happen anymore.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Some PNG textures cause segfaults

Post by Graf Zahl »

Yup. It seems to be random chance that on Windows the values in these variables just happen to be something that doesn't make it throw up.
The entire 'tRNS' case is broken, it has to readjust the file pointer in case it doesn't read anything.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Linux] Some PNG textures cause segfaults

Post by Edward-san »

Shouldn't the fix be merged in the maint branch together with this commit?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Some PNG textures cause segfaults

Post by Graf Zahl »

There's probably more that needs to be merged into maint. But that can wait until a new release is imminent.
Post Reply

Return to “Closed Bugs [GZDoom]”