summaryrefslogtreecommitdiff
path: root/poppler/JPEG2000Stream.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-08-01 19:30:28 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-08-01 19:30:28 +0200
commitfe97135ffb18eaaec7d23a7394641ba103bfe48d (patch)
tree3727286d07f247191f3dc1c65aba161fa6c6cec0 /poppler/JPEG2000Stream.cc
parente5ff049c3d11e6ea24b624807730acd21a6ef4d5 (diff)
Make the openjpeg1 code compile with the new Object API
Diffstat (limited to 'poppler/JPEG2000Stream.cc')
-rw-r--r--poppler/JPEG2000Stream.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index 2b6af900..12ee33f1 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -196,25 +196,20 @@ static void libopenjpeg_warning_callback(const char *msg, void * /*client_data*/
void JPXStream::init()
{
Object oLen, cspace, smaskInData;
- if (getDict()) getDict()->lookup("Length", &oLen);
- if (getDict()) getDict()->lookup("ColorSpace", &cspace);
- if (getDict()) getDict()->lookup("SMaskInData", &smaskInData);
+ if (getDict()) oLen = getDict()->lookup("Length");
+ if (getDict()) cspace = getDict()->lookup("ColorSpace");
+ if (getDict()) smaskInData = getDict()->lookup("SMaskInData");
int bufSize = BUFFER_INITIAL_SIZE;
if (oLen.isInt()) bufSize = oLen.getInt();
- oLen.free();
if (cspace.isArray() && cspace.arrayGetLength() > 0) {
- Object cstype;
- cspace.arrayGet(0, &cstype);
+ Object cstype = cspace.arrayGet(0);
if (cstype.isName("Indexed")) priv->indexed = gTrue;
- cstype.free();
}
- cspace.free();
priv->smaskInData = 0;
if (smaskInData.isInt()) priv->smaskInData = smaskInData.getInt();
- smaskInData.free();
int length = 0;
unsigned char *buf = str->toUnsignedChars(&length, bufSize);