[Gtkradiant] [Bug 288] New: q3map barfs if more than 3 root shaders are specified for terrain

gtkradiant@zerowing.idsoftware.com gtkradiant@zerowing.idsoftware.com
Mon, 07 Jan 2002 01:32:31 -0600


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=288

           Summary: q3map barfs if more than 3 root shaders are specified
                    for terrain
           Product: GtkRadiant
           Version: 1.1.2-nightly
        OS/Version: Windows 9x
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tools
        AssignedTo: ttimo@idsoftware.com
        ReportedBy: rfm@redshift.com


I found this using 1.1.1 with RTCW, but it should not be game specific.

q3map gives the error when you try to compile a map with a terrrain entity that
has more than three root shaders and a corresponding alphamap:
************ ERROR ************
safe_malloc failed on allocation of 926365492 bytes

The number value seems to come from uninitialized data. I haven't seen what
happens if you actually have 900 megs available to allocate. This happens in
1.1.1 as well as 1.1.2-nightly. I'm currently unable to test 1.2 with wolf, but
the same code does seem to exist in my fairly recent 1.2 CVS. Reducing the
number of shaders and alphamap components to 3 makes the problem go away. Wolf
terrains seem to use more than 3 shaders per terrain.

The error comes from tools\quake3\q3map\terrain.c:EmitTerrainVerts
This is called from SetTerrainTextures, which has a  a note in there from ttimo:
  // TTimo the number of layers is not supposed to be limited to 3? who said that?
  // tried to comment out this line but it seems it doesn't solve the problem
  // 
	num_layers = 3;


Apperently it's been noticed before, but I couldn't find it in bugzilla, so here
it is.

msdev stack trace:
safe_malloc(unsigned int 926365492) line 59
EmitTerrainVerts(side_s * 0x06b5ef54, terrainSurf_t * 0x07484ac4, int 3, int *
0x0427f39c, int 1) line 452 + 12 bytes
SetTerrainTextures() line 684 + 32 bytes
ParseMapEntity() line 1146
LoadMapFile(char * 0x02876780 _name) line 1183 + 5 bytes
main(int 2, char * * 0x045b0740) line 878 + 10 bytes
[...]



------- You are receiving this mail because: -------
Whoops!  I have no idea!