[softwarelist] Re: OvnPro 2.77 type 5 errors

In message <501b26a683asgard@xxxxxxxxxxxxxx>, Keith Hopper <asgard@xxxxxxxxxxxxxx> writes
    Shredded Wheat!

I think I've sorted the problem now. It seems a very complicated situation, Artworks images being rendered in irregular frames. But the actual bug is rather simple.

I create a sprite and I don't initialise all the parameters. That means that one of them is dependent upon the random contents of memory - presumably why you have to scroll the document a few times before it crashes.

More interesting is why I've failed to set up the sprite correctly. Relatively recently, RISC OS Ltd. extended the sprite format to support an alpha (variable transparency) channel. None of my software actually uses this but I needed to be able to handle extended sprites, so I changed my C header files to support the extra bit which signifies a sprite with an alpha channel.

The bug was caused by not initialising this new alpha channel bit when sprites were created, in other words by not changing all the source code that included the header files.

I'll check out if the crash is fixed by this change, see if I've made the same mistake elsewhere and let you know when the resulting new version is available.

Artworks files have nothing to do with the problem, and any type of graphic in an irregular frame would cause it.

There's a case to be made for filling all allocated memory with zero, this hides bugs like the above or at least gives consistent results - Windows does it for security reasons - do we have enough ARM processor cycles to spare?


--
David Pilling
email: david@xxxxxxxxxxxxxxxxxxx
  web: http://www.davidpilling.net
 post: David Pilling P.O. Box 22 Thornton Cleveleys Blackpool. FY5 1LR UK
  fax: +44(0)870-0520-941


To unsubscribe or subscribe goto: http://www.freelists.org/list/davidpilling

Other related posts: