Commit 0894e7e
committed
GS: Snapshot the display resolution for cross-thread reads
GSgetDisplayResolution() took a raw pointer from g_gs_renderer and
dereferenced it, but guncon2 calls it from the EE thread. If the GS
thread reopened the renderer between the null check and the read, the
pointer dangled.
Store the resolution on the GS thread where it is already computed and
read the copy instead. This matches s_last_draw_rect directly above it,
which exists for this exact reason and which the same guncon2 call site
already reads via GSTranslateWindowToDisplayCoordinates.
Reported by chaoticgd.1 parent 929cd22 commit 0894e7e
2 files changed
Lines changed: 9 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | 665 | | |
681 | 666 | | |
682 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| |||
997 | 1000 | | |
998 | 1001 | | |
999 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1000 | 1009 | | |
1001 | 1010 | | |
1002 | 1011 | | |
| |||
0 commit comments