summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2022-10-16 12:25:34 +0200
committerAlbert Astals Cid <aacid@kde.org>2022-10-16 12:25:34 +0200
commite471f8e09bf2e38df0cf5df1acecbcca70685573 (patch)
tree728b84ee0a9c5afdbb1aa11fcc11bb65df1e9d85
parent5190c0d4369bd9f501922585140be4ec736e24f2 (diff)
Init all the fields of JPXStreamPrivate
oss-fuzz/52372
-rw-r--r--poppler/JPEG2000Stream.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index fcd8903e..c480ba27 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -33,12 +33,12 @@
struct JPXStreamPrivate
{
- opj_image_t *image;
- int counter;
- int ccounter;
- int npixels;
- int ncomps;
- bool inited;
+ opj_image_t *image = nullptr;
+ int counter = 0;
+ int ccounter = 0;
+ int npixels = 0;
+ int ncomps = 0;
+ bool inited = false;
void init2(OPJ_CODEC_FORMAT format, const unsigned char *buf, int length, bool indexed);
};
@@ -80,10 +80,6 @@ static inline int doGetChar(JPXStreamPrivate *priv)
JPXStream::JPXStream(Stream *strA) : FilterStream(strA)
{
priv = new JPXStreamPrivate;
- priv->inited = false;
- priv->image = nullptr;
- priv->npixels = 0;
- priv->ncomps = 0;
}
JPXStream::~JPXStream()