#7 Memory fix in MtlKeeper.cpp

closed
None
5
2007-09-27
2007-05-08
No

We've noticed that OSGExp crashes when exporting models with large amounts of textures. I tracked down the problem to the createImage() method. When allocating the data for the image it would use sizeof(GL_UNSIGNED_BYTE) to calculate the data size. I believe this is incorrect, because GL_UNSIGNED_BYTE is not a data type, it is an integer value. So the size will be 4 on most systems. This results in allocating 4 times the amount of memory needed. The fix is to use sizeof(unsigned char) instead. I've attached a patch which includes this fix.

Discussion

  • Farshid Lashkari

     
    Attachments
  • Joran Jessurun

    Joran Jessurun - 2007-09-27
    • assigned_to: nobody --> j0ran
     
  • Joran Jessurun

    Joran Jessurun - 2007-09-27
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks