From 0441ba1ab068d239a4360c20a55be284d9a9e4f5 Mon Sep 17 00:00:00 2001 From: Lubos Date: Tue, 29 Mar 2022 12:58:09 +0200 Subject: [PATCH] Do not crash on undefined LOD --- android/app/src/main/cpp/code/renderergl2/tr_mesh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/app/src/main/cpp/code/renderergl2/tr_mesh.c b/android/app/src/main/cpp/code/renderergl2/tr_mesh.c index 7ae71f3c..967199d0 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_mesh.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_mesh.c @@ -172,6 +172,8 @@ int R_ComputeLOD( trRefEntity_t *ent ) { int lod = r_lodbias->integer + r_lodbias->integer; if (lod >= tr.currentModel->numLods) lod = tr.currentModel->numLods - 1; + if (lod < 0) + lod = 0; return lod; }