resolve segfault for close right wall view

This commit is contained in:
hugogogo
2022-05-04 00:58:20 +02:00
parent 3c76a8646a
commit b5f3d2d384
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ F 220 , 100, 30
C 225 , 30 , 0
1111111111111111111111111111
10000000000000000111N0000001
10000000000000000111W0000001
1111000000000000100000110001
1111001000000000000110000111
1000000000000000010101000001

View File

@@ -26,7 +26,7 @@ static int get_texture(t_img *img, int imgx, int j, int height)
int y;
int position;
y = (j * img->height) / height;
y = ((long)j * (long)img->height) / height;
position = y * img->szl + imgx * (img->bpp / 8);
color = img->data + position;
return (*(int *)color);