Menu ▾ ▴

Code Merge Request #1: bb: Fix z-buffer overflow on 64-bit systems (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Anders Kaseorg wants to merge 1 commit from /u/anders0/aa-project/ to master, 2026-10-05

The z-buffer is an int array allocated with sizeof(int) per pixel, but clear_zbuff cleared sizeof(long) per pixel, writing past the end of the buffer on LP64 systems every frame of scene 5. This corrupted the heap or, once the buffer was large enough to be mmapped (a terminal of about 200x50 or more), segfaulted right away.

Commit Date  
[d33eb1] (bb-zbuffer-overflow) by Anders Kaseorg Anders Kaseorg

bb: Fix z-buffer overflow on 64-bit systems.

The z-buffer is an int array allocated with sizeof(int) per pixel, but
clear_zbuff cleared sizeof(long) per pixel, writing past the end of the
buffer on LP64 systems every frame of scene 5. This corrupted the heap
or, once the buffer was large enough to be mmapped (a terminal of about
200x50 or more), segfaulted right away.

Co-Authored-By: Claude Opus 5.5 <noreply@...>

2026-10-05 22:26:26 Tree

Discussion


Log in to post a comment.