diff options
author | Albert Astals Cid <aacid@kde.org> | 2022-10-16 12:21:59 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2022-10-16 12:21:59 +0200 |
commit | 5190c0d4369bd9f501922585140be4ec736e24f2 (patch) | |
tree | 75514e1a742e9976bb3f970b69278daaf3fd2c29 | |
parent | 6263bb90b09326103b10e4c4edfbc5b84c884921 (diff) |
No need to store smaskInData in priv
-rw-r--r-- | poppler/JPEG2000Stream.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc index 2b9e4474..fcd8903e 100644 --- a/poppler/JPEG2000Stream.cc +++ b/poppler/JPEG2000Stream.cc @@ -39,7 +39,6 @@ struct JPXStreamPrivate int npixels; int ncomps; bool inited; - int smaskInData; void init2(OPJ_CODEC_FORMAT format, const unsigned char *buf, int length, bool indexed); }; @@ -244,11 +243,11 @@ static OPJ_BOOL jpxSeek_callback(OPJ_OFF_T seek_pos, void *p_user_data) void JPXStream::init() { - Object oLen, cspace, smaskInData; + Object oLen, cspace, smaskInDataObj; if (getDict()) { oLen = getDict()->lookup("Length"); cspace = getDict()->lookup("ColorSpace"); - smaskInData = getDict()->lookup("SMaskInData"); + smaskInDataObj = getDict()->lookup("SMaskInData"); } int bufSize = BUFFER_INITIAL_SIZE; @@ -264,11 +263,7 @@ void JPXStream::init() } } - priv->smaskInData = 0; - if (smaskInData.isInt()) { - priv->smaskInData = smaskInData.getInt(); - } - + const int smaskInData = smaskInDataObj.isInt() ? smaskInDataObj.getInt() : 0; const std::vector<unsigned char> buf = str->toUnsignedChars(bufSize); priv->init2(OPJ_CODEC_JP2, buf.data(), buf.size(), indexed); @@ -292,7 +287,7 @@ void JPXStream::init() } priv->npixels = priv->image->comps[0].w * priv->image->comps[0].h; priv->ncomps = priv->image->numcomps; - if (alpha == 1 && priv->smaskInData == 0) { + if (alpha == 1 && smaskInData == 0) { priv->ncomps--; } for (int component = 0; component < priv->ncomps; component++) { |