diff options
| author | Simon Tatham <anakin@pobox.com> | 2015-05-08 19:07:33 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-05-08 19:07:33 +0100 |
| commit | 0a9497c46541e4d8d317b75cde4ac1f62e9affe8 (patch) | |
| tree | 9dbe9fc02a577b4013db57d2d0481ad651ff51d7 | |
| parent | 6f1c6378cf01dd5d91c5dbcba987555bfbd029d5 (diff) | |
| download | halibut-0a9497c46541e4d8d317b75cde4ac1f62e9affe8.zip halibut-0a9497c46541e4d8d317b75cde4ac1f62e9affe8.tar.gz halibut-0a9497c46541e4d8d317b75cde4ac1f62e9affe8.tar.bz2 halibut-0a9497c46541e4d8d317b75cde4ac1f62e9affe8.tar.xz | |
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.
| -rw-r--r-- | bk_pdf.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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) |