Skip to content

Fix: segfault when connecting to a server with cg_oversampleMouse 1#83

Merged
snems merged 1 commit intosnems:masterfrom
metaq3:fix/ub/mouse-oversample
May 4, 2026
Merged

Fix: segfault when connecting to a server with cg_oversampleMouse 1#83
snems merged 1 commit intosnems:masterfrom
metaq3:fix/ub/mouse-oversample

Conversation

@metaq3
Copy link
Copy Markdown
Contributor

@metaq3 metaq3 commented May 3, 2026

Simple correction for native builds and overall code sanity.

How to reproduce:

  • Start quake with native library loaded, e.g. with sv_pure 0 and vm_cgame 0
  • Set cg_oversampleMouse to 1 and /devmap any map or connect to any server
  • Observe kernel sending signal 11 ( SIGSEGV ) to your quake instance

Why

With cg_oversampleMouse 1 client prediction calls PM_UpdateViewAngles, which, in turn, uses nullish pm. This is only the first frame, so Pmove, which updates pm to valid pmove, has not been called yet, so pm is NULL.

It's clear that this is an oversight, all the other code of the func uses ps provided in the args, not pm->ps.

@snems
Copy link
Copy Markdown
Owner

snems commented May 4, 2026

OSP 1.03 also uses ps. Thanks!

@snems snems merged commit 71becc8 into snems:master May 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants