From 104c29e4daa2d5cb479e24e8d65ef31881f413fd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 20 Mar 2011 09:54:38 +0900 Subject: [PATCH] Avoid a segfault when the called function is invalid. This is most likely to occur when dumping code from qfo files with external functions. --- libs/gamecode/engine/pr_debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/gamecode/engine/pr_debug.c b/libs/gamecode/engine/pr_debug.c index 8d7d34daf..7ee09bc0d 100644 --- a/libs/gamecode/engine/pr_debug.c +++ b/libs/gamecode/engine/pr_debug.c @@ -877,6 +877,9 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) break; case 'F': str = global_string (pr, opval, optype, contents & 1); + if (G_FUNCTION (pr, opval) >= 0 + && G_FUNCTION (pr, opval) + < pr->progs->numfunctions) call_func = pr->pr_functions + G_FUNCTION (pr, opval); break; case 'P':