bug id LoadTexMono

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++amcor.bvr.co.il)
Sun, 25 Dec 1994 16:55:36 +0000


Marcus,

I've located a bug in the flt14 loader, in the function ReadimageSGI, called
from LoadTexMono. When the type of the rgb image is RLE, the function allocates
space for one channel only for the image :

line 4852 : *image = ( unsigned char * ) malloc ( wordsxrnd * Patheight );

This will cause a Bus Error later, since the function reads more than
wordsxrnd * Patheight bytes from the file.

In my private version I've changed this line to :

        *image = ( unsigned char * ) malloc ( wordsxrnd * Patheight * zsize );

Another minor point is that after calling LoadTexMono() from getTexture(), the
code proceeds and reads the old (rgb or rgba) texture attribute file. I suppose
it doesn't matter, since the only difference is the image type, but for
cleanness I would suggest you add the line

        strcpy (path, outfilename);
right after the loading of the monochrome image in LoadTexMono().

Regards,

Ran

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | Graphics App. Chief Engineer
/ )_ (_(_) )   \/ (_(_/<_(_)(        | BVR Technologies Ltd.
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++bvr.co.il
  Work : 972-3-5715671               |
  Res. : 972-3-6995364               |
Fax    : 972-3-5715668               |

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:46 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.