Skip to content

Commit 316b73d

Browse files
Fixed crash-bug in sector.c.
1 parent 98f6bbb commit 316b73d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/sector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ void set_sector(int x, int y) {
6464
int n, m;
6565
unsigned long long prof;
6666

67+
if (x < 0 || x >= MAXMAP || y < 0 || y >= MAXMAP) return;
68+
6769
prof = prof_start(21);
6870

6971
for (n = 0; n < 8; n++) {
@@ -78,6 +80,8 @@ void set_sector(int x, int y) {
7880
int skipx_sector(int x, int y) {
7981
int n, m, size;
8082

83+
if (x < 0 || x >= MAXMAP || y < 0 || y >= MAXMAP) return 0;
84+
8185
for (n = 7; n >= 0; n--) {
8286
m = (x >> n) + (y >> n) * (MAXMAP >> n);
8387

0 commit comments

Comments
 (0)