[gs-commits] mupdf 1.16.1.38 Bug 701556: Return zero when evaluating d

[email protected] (Sebastian Rasmussen)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit 7d6039ff1b57a07efe0beb0f58b9c947fac3c3aa
Author: Sebastian Rasmussen <[email protected]>
Date:   Mon Sep 9 14:16:43 2019 +0200

    Bug 701556: Return zero when evaluating degenerate exponential function.
    
    Previously the outputs of degenerate exponential functions were
    left uninitialized, causing issues when the values were used later.
    
    Thanks to oss-fuzz for reporting.

diff --git a/source/pdf/pdf-function.c b/source/pdf/pdf-function.c
index 1bbdbc1..e9214b5 100644
--- a/source/pdf/pdf-function.c
+++ b/source/pdf/pdf-function.c
@@ -1179,7 +1179,11 @@ eval_exponential_func(fz_context *ctx, pdf_function *func, float in, float *out)
 
 	/* Default output is zero, which is suitable for violated constraints */
 	if ((func->u.e.n != (int)func->u.e.n && x < 0) || (func->u.e.n < 0 && x == 0))
+	{
+		for (i = 0; i < func->n; i++)
+			out[i] = 0;
 		return;
+	}
 
 	tmp = powf(x, func->u.e.n);
 	for (i = 0; i < func->n; i++)

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=7d6039ff1b57a07efe0beb0f58b9c947fac3c3aa

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.