From 81a1ae0580404be5dcb69e1a523987c52fcc0508 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 25 Jul 2012 11:40:36 +0000 Subject: ps2pkm: Bug fix: Pretend that the first pixel of an empty glyph is white otherwise the test case may use uninitialized data and fail git-svn-id: svn://tug.org/texlive/trunk@27153 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ps2pkm/ChangeLog | 6 ++++++ Build/source/texk/ps2pkm/pkout.c | 3 +++ 2 files changed, 9 insertions(+) (limited to 'Build/source/texk/ps2pkm') diff --git a/Build/source/texk/ps2pkm/ChangeLog b/Build/source/texk/ps2pkm/ChangeLog index 9deaa83dd10..d78269b36ae 100644 --- a/Build/source/texk/ps2pkm/ChangeLog +++ b/Build/source/texk/ps2pkm/ChangeLog @@ -1,3 +1,9 @@ +2012-07-25 Peter Breitenlohner + + * pkout.c (pk_runlengths): Pretend that the first pixel of an + empty glyph is white; avoid using uninitialized data. + Found by Martin Schroeder . + 2012-07-15 Peter Breitenlohner * ps2pk.c: Invoke kpse_set_program_name() with original argv[0] diff --git a/Build/source/texk/ps2pkm/pkout.c b/Build/source/texk/ps2pkm/pkout.c index cb6cb627b63..d1b2952c886 100644 --- a/Build/source/texk/ps2pkm/pkout.c +++ b/Build/source/texk/ps2pkm/pkout.c @@ -207,6 +207,9 @@ static void pk_runlengths(int W, int H, int (*next_pixel)()) if (runlength>0) count[cnt++] = runlength; + /* for an empty glyph */ + if (cnt == first_count) count[cnt++] = 0; + #ifdef DEBUG current_value = BLACK; for (i=first_count; i