Commit afd11ec6 authored by Albert Astals Cid's avatar Albert Astals Cid

* poppler/Annot.cc: avoid crashing if the font for the drawing methods

        can not be found
        * poppler/Form.cc: fix memory leak
        * qt4/src/poppler-private.h: fix the UnicodeParsedString function to
        really work and not crash
        * splash/SplashTypes.h: RGB8X mode makes max number of components in
        any SplashColor always be 4
parent f019c8a8
2007-05-21 Pino Toscano <pino@kde.org>
reviewed by: Albert Astals Cid <aacid@kde.org>
* poppler/Annot.cc: avoid crashing if the font for the drawing methods
can not be found
* poppler/Form.cc: fix memory leak
* qt4/src/poppler-private.h: fix the UnicodeParsedString function to
really work and not crash
* splash/SplashTypes.h: RGB8X mode makes max number of components in
any SplashColor always be 4
2007-05-17 Pino Toscano <pino@kde.org>
* qt4/src/poppler-link.cc:
......
......@@ -858,6 +858,9 @@ void Annot::drawText(GooString *text, GooString *da, GfxFontDict *fontDict,
} else {
error(-1, "Missing 'Tf' operator in field's DA string");
}
if (!font) {
return;
}
// get the border width
border = borderStyle->getWidth();
......@@ -1174,6 +1177,9 @@ void Annot::drawListBox(GooString **text, GBool *selection,
} else {
error(-1, "Missing 'Tf' operator in field's DA string");
}
if (!font) {
return;
}
// get the border width
border = borderStyle->getWidth();
......
......@@ -458,6 +458,7 @@ void FormWidgetChoice::loadDefaults ()
obj.getDict()->set("Opt", objOpt);
xref->setModifiedObject(&obj, ref);
#endif
delete [] tmpCurrentChoice;
}
FormWidgetChoice::~FormWidgetChoice()
......
......@@ -61,11 +61,14 @@ namespace Poppler {
}
static QString UnicodeParsedString(GooString *s1) {
if ( !s1 || s1->getLength() == 0 )
return QString();
GBool isUnicode;
int i;
Unicode u;
QString result;
if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff )
if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) )
{
isUnicode = gTrue;
i = 2;
......
......@@ -52,11 +52,7 @@ enum SplashColorMode {
extern int splashColorModeNComps[];
// max number of components in any SplashColor
#if SPLASH_CMYK
# define splashMaxColorComps 4
#else
# define splashMaxColorComps 3
#endif
#define splashMaxColorComps 4
typedef Guchar SplashColor[splashMaxColorComps];
typedef Guchar *SplashColorPtr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment