[poppler] poppler/JPEG2000Stream.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Oct 16 10:29:36 UTC 2022


 poppler/JPEG2000Stream.cc |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit e471f8e09bf2e38df0cf5df1acecbcca70685573
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Oct 16 12:25:34 2022 +0200

    Init all the fields of JPXStreamPrivate
    
    oss-fuzz/52372

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()


More information about the poppler mailing list