[Ohrrpgce] [ohrrpgce/ohrrpgce] Corrupt tileset graphics and crash in Test Game after changing tilesets or reordering layers (#41)

Ralph Versteegen notifications at github.com
Mon Nov 18 18:17:35 PST 2019


Changing map layer tilesets or reordering tilesets can cause Game to crash or draw a map layer with a corrupt tileset. It turns out that while reloading the map, new tilesets are loaded into `tilesets()` but the Map slices' tileset pointers aren't updated. In practice swapping map layers may or may not cause a `TilesetData` to be freed, and if it is, it might not be overwritten immediately, so the map layer might continue to display with the old tileset, or the tileset sprite ptr might become garbage. Also, I've seen the game continue to run for a minute and then suddenly crash without user input.

We have many crashreports for this, and I've received a few bug reports, which I hadn't realised were all the same bug.

There are no writes to a TilesetData or anything it contains via a Map slice tileset ptr, so this bug can't cause further memory corruption. All crashes are inside `drawmap` called from `DrawMapSlice`. E.g.

```
85fb4b  20190602  Game    wip 20190520.11162           memcpy(msvcrt.dll) <- blitohr <- FRAME_DRAW_INTERNAL <- DRAWMAP <- DRAWMAP <- DRAWMAP <- DrawMapSlice
                  Admin   Kagome.rpg                   
3602b9  20191001  Game    wip 20190912.11319           DRAWMAP(allmodex.bas:3722) <- DRAWMAP <- DRAWMAP <- DrawMapSlice <- DrawSliceRecurse <- DefaultChildDraw
                  DELL    Blood Ledger.rpg Blood Ledg  
```

So this can't be the cause of bug #10 (crash while creating a minimap).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/41
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20191118/3619a180/attachment.html>


More information about the Ohrrpgce mailing list