Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ames!sgi!shinobu!odin!nelson From: nelson@sgi.com (Nelson Bolyard) Newsgroups: comp.windows.ms Subject: Re: Program Manager UAE caused by .ICO file !?! Summary: Problem found and fixed Keywords: UAE icon PROGMGR Message-ID: <1991Feb26.190454.20334@odin.corp.sgi.com> Date: 26 Feb 91 19:04:54 GMT References: <1991Feb22.033739.26361@odin.corp.sgi.com> Sender: news@odin.corp.sgi.com (Net News) Distribution: na Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 37 Several of those who responded to my complaint about the bad .ICO file offered to try to repair the file. Some offered to use the SDK paint program to fix it, but it caused the paint program to crash also! One respondent, who had written his own paint program, was able to fix the file. Here is his reply: >Date: Sat, 23 Feb 91 17:04:39 EST >From: nee@cf_su10.sbi.com (Robert Nee) >Subject: Re: Bad .ICO file >I took a look at the file you sent me. Sure enough, it causes the PM >to crash. It also made SDK paint crash (the icon painter in the SDK). >Oddly though, it didn't make my program crash so I took a look at the >file in more detail. Icon files have what's known as an icon resource >directory at the beginning that describes the number and types of icons >in the file. There is also a length specifier. It turns out that this >was causing the problem. It claimed that the icon portion of the file >was only 728 bytes long rather than the correct value of 744. PM and >SDK Paint must use this value to allocate memory rather that calculating >the proper value themselves. When they go to read in the pieces of >the icon file they write past the end of this memory, and BOOM! >When I repaired the IR header, the file worked fine. Here it is and I hope >you find it helpful. I know I found this interesting and informative. >The file formats are in the SDK docs. The reference manual has a section >with a number of file formats listed. You can buy this book in the >stores too. >Robert F. Nee Thanks, Robert! ----------------------------------------------------------------------------- Nelson Bolyard nelson@sgi.COM {decwrl,sun}!sgi!whizzer!nelson Disclaimer: Views expressed herein do not represent the views of my employer. -----------------------------------------------------------------------------