1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00

Fix segfault

This commit is contained in:
Miloslav Číž 2019-06-03 18:44:53 +02:00
parent 68d1028d2b
commit 4354e98908
2 changed files with 4 additions and 3 deletions

View file

@ -1531,7 +1531,8 @@ void S3L_drawTriangle(
loop */ loop */
#endif #endif
if (rXClipped < lXClipped) if (rXClipped < lXClipped &&
lXClipped < S3L_RESOLUTION_X && rXClipped >= 0)
{ {
/* This can sometimes happen because of numerical errors in sorting /* This can sometimes happen because of numerical errors in sorting
left vs right triangle point, which are compared based on SLOPE, not left vs right triangle point, which are compared based on SLOPE, not

View file

@ -18,8 +18,8 @@
#define S3L_PIXEL_FUNCTION drawPixel #define S3L_PIXEL_FUNCTION drawPixel
#define S3L_RESOLUTION_X 110 #define S3L_RESOLUTION_X 640
#define S3L_RESOLUTION_Y 88 #define S3L_RESOLUTION_Y 480
#include "small3dlib.h" #include "small3dlib.h"