[Linux] Some PNG textures cause segfaults
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Linux] Some PNG textures cause segfaults
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.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: [Linux] Some PNG textures cause segfaults
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?
'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?
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: [Linux] Some PNG textures cause segfaults
Aha, if I add 'else lump->Seek (len, SEEK_CUR);' after the if (ColorType == 3) block, the crash doesn't happen anymore.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Linux] Some PNG textures cause segfaults
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.
The entire 'tRNS' case is broken, it has to readjust the file pointer in case it doesn't read anything.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: [Linux] Some PNG textures cause segfaults
Shouldn't the fix be merged in the maint branch together with this commit?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Linux] Some PNG textures cause segfaults
There's probably more that needs to be merged into maint. But that can wait until a new release is imminent.