poppler/PSOutputDev.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit 3a6e2de1d35e3ee4fd86f71713c49bec8e09e41d Author: Albert Astals Cid <[email protected]> Date: Thu May 16 21:27:02 2013 +0200 Make sure that Title: doesn't contain \n or \n Bug #63862 diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 95be97f..3f04696 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -15,7 +15,7 @@ // // Copyright (C) 2005 Martin Kretzschmar <[email protected]> // Copyright (C) 2005, 2006 Kristian Høgsberg <[email protected]> -// Copyright (C) 2006-2009, 2011, 2012 Albert Astals Cid <[email protected]> +// Copyright (C) 2006-2009, 2011-2013 Albert Astals Cid <[email protected]> // Copyright (C) 2006 Jeff Muizelaar <[email protected]> // Copyright (C) 2007, 2008 Brad Hards <[email protected]> // Copyright (C) 2008, 2009 Koji Otani <[email protected]> @@ -1414,7 +1414,14 @@ void PSOutputDev::writeHeader(int firstPage, int lastPage, obj1.free(); info.free(); if(psTitle) { - writePSFmt("%%Title: {0:s}\n", psTitle); + char *sanitizedTile = strdup(psTitle); + for (Guint i = 0; i < strlen(sanitizedTile); ++i) { + if (sanitizedTile[i] == '\n' || sanitizedTile[i] == '\r') { + sanitizedTile[i] = ' '; + } + } + writePSFmt("%%Title: {0:s}\n", sanitizedTile); + free(sanitizedTile); } writePSFmt("%%LanguageLevel: {0:d}\n", (level == psLevel1 || level == psLevel1Sep) ? 1 :
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
