Ambermoon icon indicating copy to clipboard operation
Ambermoon copied to clipboard

Investigating reported code bugs

Open Pyrdacor opened this issue 2 years ago • 0 comments

A guy called st-th mentioned some code bugs long ago. Maybe I can find and fix some of them. Original text:

It may sound funny, but all those corrupted text files are not the real problem. Sure, they are the most obvious "in your face" bugs, crashing the game to boot, but they can be properly fixed eventually. I have some ideas about it and when they work out, it will actually be rather trivial.

However, the real problem are code bugs. To give you an idea, here are a few small ones I've fixed:

  • Calling graphics.library's VideoControl() function with a messed-up pointer argument. This affects every system running OS 3.0 or newer and could result in sprite display errors during and after the game.

  • Testing the result of dos.library's Open() function with a wrong conditional branch with the result that every failure to open a file is treated as success followed by subsequent accesses to an illegal file handle.

  • A major logic bug in handling a status flag which could result in messing up internal structures.

  • Not restoring pr_WindowPtr to its original value under certain circumstances which will crash the system the moment dos.library wants to display a requester.

And the list goes on and on... The game opens libraries and uses them without checking for open failure. It has memory leaks under certain circumstances. It even has classic buffer overrun bugs (try inputting all words from the game's dictionary at a riddlemouth).

Mentioned here by @a1exh: #66

Pyrdacor avatar Sep 16 '22 17:09 Pyrdacor