Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential fix for voxels on top/bottom of screen #2134

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/r_voxel.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,13 +871,14 @@
fixed_t uy0 = uy1;

// clip the slab vertically
if (uy1 >= clip_y2) break;
if (uy2 <= clip_y1) continue;
if (uy1 >= clip_y2) uy1 = clip_y2;
if (uy2 <= clip_y1) uy2 = clip_y1;

if (uy1 < clip_y1) uy1 = clip_y1;
if (uy2 > clip_y2) uy2 = clip_y2;

boolean has_side = ((face & (ux > Bx ? B_face : A_face)) != 0);
boolean has_side = ((face & (ux > Bx ? B_face : A_face)) != 0
&& uy1 < clip_y2 && uy2 > clip_y1);

// handle the fuzz effect for Spectres
if (shadow)
Expand Down Expand Up @@ -1055,7 +1056,7 @@
{
int i;
for (i = 0 ; i < 256 ; i++)
new_colormap[i] = map[trans[i]];

Check warning on line 1059 in src/r_voxel.c

View workflow job for this annotation

GitHub Actions / Clang-Tidy

src/r_voxel.c:1059:27 [clang-analyzer-core.NullDereference]

Array access (from variable 'trans') results in a null pointer dereference

prev_trans = trans;
prev_map = map;
Expand Down