From 172c80a581d68259a3aed3cf2b46b61c15e96fee Mon Sep 17 00:00:00 2001 From: Anuj Khare Date: Mon, 23 Jun 2014 19:56:10 +0530 Subject: [PATCH] Core: Fix issue when adding annot without contents Having no content in an annotation results in a crash when generating it's appearance, since the contents pointer is dereferenced. --- poppler/Annot.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poppler/Annot.cc b/poppler/Annot.cc index fa29739..8d1dac5 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -3015,6 +3015,8 @@ void AnnotFreeText::generateFreeTextAppearance() fontsize = 10; if (fontcolor == NULL) fontcolor = new AnnotColor(0, 0, 0); // Black + if (!contents) + contents = new GooString (""); // Draw box GBool doFill = (color && color->getSpace() != AnnotColor::colorTransparent); -- 1.9.1