From 0a9497c46541e4d8d317b75cde4ac1f62e9affe8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 8 May 2015 19:07:33 +0100 Subject: Fix an uninitialised variable in PDF font code. Thanks to Paul Curtis for reporting that 'if (i != prev+1)' would be undefined on the first pass through this loop, because prev was never initialised beforehand. Initialise it to a safe value. --- bk_pdf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bk_pdf.c b/bk_pdf.c index 10b9fdd..c66b742 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -317,6 +317,8 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(font, "/Subtype /Type1\n"); objtext(font, "\n/Encoding <<\n/Type /Encoding\n/Differences ["); + prev = 256; /* ensure we compare unequal in 1st iteration */ + for (i = 0; i < 256; i++) { char buf[20]; if (fe->vector[i] == NOGLYPH) -- cgit v1.1