Ticket #236 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Crash/Assert when loading 3ds model

Reported by: pjakobs@… Owned by: admin
Priority: major Milestone: Version 1.0.1
Component: other plugins Version: V1.0
Keywords: 3ds Cc:

Description (last modified by res) (diff)

When loading the attached world with walktest, the application crashes while loading the embedded 3ds model.

Windows XP, Visual Studio 8.0, CS 1.0 (Debug build), Intel 82915G Express

It think the size of the index buffer in the code below is too small. Multiplying its size by 3 seems to do the trick. I don't have time to have a good look at it. Somebody more familiar with the code might have a look at it.

gmesh3ds.cpp, line: 388

      csRef<iRenderBuffer> indexBuffer = csRenderBuffer::CreateIndexRenderBuffer (
        materials_and_tris[j].tris.GetSize(), CS_BUF_STATIC, 
        CS_BUFCOMP_UNSIGNED_INT, 0, gmstate->GetVertexCount() - 1);
      {
        csRenderBufferLock<uint> indices (indexBuffer);
        csTriangle* tris = gmstate->GetTriangles();
        for (size_t i = 0; i < materials_and_tris[j].tris.GetSize(); i++)
        {
          uint tri = materials_and_tris[j].tris[i];
          *indices++ = tris[tri].a;
          *indices++ = tris[tri].b;
          *indices++ = tris[tri].c;
        }
      }

Attachments

myworld.zip Download (183.4 KB) - added by pjakobs@… 4 years ago.
world including 3ds model

Change History

Changed 4 years ago by pjakobs@…

world including 3ds model

Changed 4 years ago by res

  • description modified (diff)
  • milestone set to Version 1.0.1

Changed 4 years ago by res

Tripling the size is the correct fix. Fixed on trunk r26217, merge to 1.0 pending.

Changed 4 years ago by res

  • status changed from new to closed
  • resolution set to fixed

Merged into 1.0 with r26383.

Add/Change #236 (Crash/Assert when loading 3ds model)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
 
Note: See TracTickets for help on using tickets.