leptonica-1.85.0-1.fc42

List of Findings

Error: COMPILER_WARNING (CWE-563): [#def1]
leptonica-1.85.0-build/leptonica-1.85.0/prog/autogen.137.h:54:20: warning[-Wunused-variable]: ‘l_strdata_0’ defined but not used
#   54 | static const char *l_strdata_0 =
#      |                    ^~~~~~~~~~~
#   52|   /*                         Serialized strings                          */
#   53|   /*---------------------------------------------------------------------*/
#   54|-> static const char *l_strdata_0 =
#   55|       "eJy1mgtUE1cax+9kQh4wIREQBhAyQCoPFYd3UEjCQ0RtC1prbbUyaBWsVvDRFRRIAjSgSwta"
#   56|       "16q1Ilq7PrpdtN3W1q1OHCtUEcTXqu0KwSpY2yWIj4Ah2aA1xJ3NIeM5cg6gnJwzv9x78/99"

Error: COMPILER_WARNING (CWE-563): [#def2]
leptonica-1.85.0-build/leptonica-1.85.0/prog/autogentest2.c:42: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/prog/autogen.137.h:155:20: warning[-Wunused-variable]: ‘l_strdata_1’ defined but not used
#  155 | static const char *l_strdata_1 =
#      |                    ^~~~~~~~~~~
#  153|       "xunS9L22LP8FbV4rjQ==";
#  154|   
#  155|-> static const char *l_strdata_1 =
#  156|       "eJy1nAdUE1n7hyckJICBhCIEKQlFQEVJRCmCJEBoNooNG4YioqKCCuKKKQRCF0SKWAARFEUE"
#  157|       "xFXswQRBRQHLisoqAdsqSmLBKIH546qB7z9fzsfsOetRgzk5Z55n5s79vfedG9X81sUFk5as"

Error: COMPILER_WARNING (CWE-563): [#def3]
leptonica-1.85.0-build/leptonica-1.85.0/prog/cleanpdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/cleanpdf.c:139:45: warning[-Wunused-variable]: unused variable ‘render_res’
#  139 | l_int32  res, contrast, rotation, opensize, render_res;
#      |                                             ^~~~~~~~~~
#  137|   {
#  138|   char    *basedir, *title, *fileout;
#  139|-> l_int32  res, contrast, rotation, opensize, render_res;
#  140|   SARRAY  *safiles;
#  141|   

Error: COMPILER_WARNING (CWE-563): [#def4]
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c:118:12: warning[-Wunused-variable]: unused variable ‘buf’
#  118 | char       buf[256];
#      |            ^~~
#  116|                char **argv)
#  117|   {
#  118|-> char       buf[256];
#  119|   char      *basedir, *title, *fileout;
#  120|   l_int32    imres, render_res, onebit, savecolor, quality;

Error: COMPILER_WARNING (CWE-563): [#def5]
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c:120:19: warning[-Wunused-variable]: unused variable ‘render_res’
#  120 | l_int32    imres, render_res, onebit, savecolor, quality;
#      |                   ^~~~~~~~~~
#  118|   char       buf[256];
#  119|   char      *basedir, *title, *fileout;
#  120|-> l_int32    imres, render_res, onebit, savecolor, quality;
#  121|   l_float32  scalefactor;
#  122|   SARRAY    *safiles;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def6]
leptonica-1.85.0-build/leptonica-1.85.0/prog/convertsegfilestopdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/convertsegfilestopdf.c:147:8: warning[-Wanalyzer-deref-before-check]: check of ‘maskdir’ for NULL after already dereferencing it
#  145|   
#  146|       setLeptDebugOK(1);
#  147|->     if (maskdir)  /* use this; ignore any input boxaafile */
#  148|           baa = convertNumberedMasksToBoxaa(maskdir, masksubstr, 0, 0);
#  149|       else if (strcmp(boxaafile, "skip") != 0) {  /* use the boxaafile */

Error: COMPILER_WARNING (CWE-563): [#def7]
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c:111:12: warning[-Wunused-variable]: unused variable ‘buf’
#  111 | char       buf[256];
#      |            ^~~
#  109|                char **argv)
#  110|   {
#  111|-> char       buf[256];
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;

Error: COMPILER_WARNING (CWE-563): [#def8]
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c:114:24: warning[-Wunused-variable]: unused variable ‘render_res’
#  114 | l_int32    printwiden, render_res;
#      |                        ^~~~~~~~~~
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;
#  114|-> l_int32    printwiden, render_res;
#  115|   l_float32  maxwiden;
#  116|   SARRAY    *safiles;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
leptonica-1.85.0-build/leptonica-1.85.0/prog/findbinding.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/findbinding.c:135:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ymax’
#  133|           /* Plot the windowed variance as a function of the y-value
#  134|            * of the window location */
#  135|->     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#  136|       gplotSimple1(na1, GPLOT_PNG, "/tmp/lept/binding/root", NULL);
#  137|       pix7 = pixRead("/tmp/lept/binding/root.png");

Error: COMPILER_WARNING (CWE-457): [#def10]
leptonica-1.85.0-build/leptonica-1.85.0/prog/findbinding.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/findbinding.c:135:5: warning[-Wmaybe-uninitialized]: ‘ymax’ may be used uninitialized
#  135 |     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/prog/findbinding.c:53:35: note: ‘ymax’ was declared here
#   53 | l_int32    w, h, ystart, yend, y, ymax, ymid, i, window, sum1, sum2, rankx;
#      |                                   ^~~~
#  133|           /* Plot the windowed variance as a function of the y-value
#  134|            * of the window location */
#  135|->     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#  136|       gplotSimple1(na1, GPLOT_PNG, "/tmp/lept/binding/root", NULL);
#  137|       pix7 = pixRead("/tmp/lept/binding/root.png");

Error: COMPILER_WARNING (CWE-563): [#def11]
leptonica-1.85.0-build/leptonica-1.85.0/prog/hashtest.c: scope_hint: In function ‘BuildShortStrings’
leptonica-1.85.0-build/leptonica-1.85.0/prog/hashtest.c:261:11: warning[-Wunused-variable]: unused variable ‘hash’
#  261 | l_uint64  hash;
#      |           ^~~~
#  259|   char      buf[64];
#  260|   l_int32   i, j, k, l, m;
#  261|-> l_uint64  hash;
#  262|   SARRAY   *sa;
#  263|   

Error: COMPILER_WARNING (CWE-563): [#def12]
leptonica-1.85.0-build/leptonica-1.85.0/prog/messagetest.c: scope_hint: In function ‘TestMessageControl’
leptonica-1.85.0-build/leptonica-1.85.0/prog/messagetest.c:138:10: warning[-Wunused-but-set-variable]: variable ‘orig_severity’ set but not used
#  138 | l_int32  orig_severity;
#      |          ^~~~~~~~~~~~~
#  136|   void TestMessageControl(l_int32  severity)
#  137|   {
#  138|-> l_int32  orig_severity;
#  139|   
#  140|       setMsgSeverity(DEFAULT_SEVERITY);

Error: COMPILER_WARNING (CWE-563): [#def13]
leptonica-1.85.0-build/leptonica-1.85.0/prog/messagetest.c: scope_hint: In function ‘TestStderrRedirect’
leptonica-1.85.0-build/leptonica-1.85.0/prog/messagetest.c:160:7: warning[-Wunused-but-set-variable]: variable ‘pix1’ set but not used
#  160 | PIX  *pix1;
#      |       ^~~~
#  158|   
#  159|   void TestStderrRedirect() {
#  160|-> PIX  *pix1;
#  161|   
#  162|           /* Output to stderr works */

Error: COMPILER_WARNING (CWE-563): [#def14]
leptonica-1.85.0-build/leptonica-1.85.0/prog/printimage.c:87:21: warning[-Wunused-but-set-variable]: variable ‘ret’ set but not used
#   87 | l_int32    i, w, h, ret, index;
#      |                     ^~~
#   85|   char      *filein, *printer, *extra, *fname;
#   86|   char       buffer[512];
#   87|-> l_int32    i, w, h, ret, index;
#   88|   l_float32  scale;
#   89|   FILE      *fp;

Error: COMPILER_WARNING (CWE-563): [#def15]
leptonica-1.85.0-build/leptonica-1.85.0/prog/printimage.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/printimage.c:89:12: warning[-Wunused-variable]: unused variable ‘fp’
#   89 | FILE      *fp;
#      |            ^~
#   87|   l_int32    i, w, h, ret, index;
#   88|   l_float32  scale;
#   89|-> FILE      *fp;
#   90|   PIX       *pixs, *pix1;
#   91|   SARRAY    *sa;

Error: COMPILER_WARNING (CWE-563): [#def16]
leptonica-1.85.0-build/leptonica-1.85.0/prog/printsplitimage.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/printsplitimage.c:78:14: warning[-Wunused-variable]: unused variable ‘fp’
#   78 | FILE        *fp;
#      |              ^~
#   76|   l_int32      nx, ny, i, w, h, ws, hs, n, index;
#   77|   l_float32    scale;
#   78|-> FILE        *fp;
#   79|   PIX         *pixs, *pixt, *pixr;
#   80|   PIXA        *pixa;

Error: COMPILER_WARNING (CWE-563): [#def17]
leptonica-1.85.0-build/leptonica-1.85.0/prog/rasteroptest.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/rasteroptest.c:59:22: warning[-Wunused-but-set-variable]: variable ‘selectop’ set but not used
#   59 | l_int32  niters, op, selectop;
#      |                      ^~~~~~~~
#   57|   BOX     *box1, *box2;
#   58|   PIX     *pix1;
#   59|-> l_int32  niters, op, selectop;
#   60|   
#   61|       setLeptDebugOK(1);

Error: COMPILER_WARNING (CWE-1164): [#def18]
leptonica-1.85.0-build/leptonica-1.85.0/prog/recog_bootnum1.c:281:7: warning[-Wunused-function]: ‘MakeBootnum2’ defined but not used
#  281 | PIXA *MakeBootnum2(void)
#      |       ^~~~~~~~~~~~
#  279|   
#  280|   
#  281|-> PIXA *MakeBootnum2(void)
#  282|   {
#  283|   char     *fname;

Error: COMPILER_WARNING (CWE-563): [#def19]
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotateorthtest1.c:49:26: warning[-Wunused-variable]: unused variable ‘pixt’
#   49 | PIX       *pixs, *pixd, *pixt;
#      |                          ^~~~
#   47|   {
#   48|   l_int32    dir;
#   49|-> PIX       *pixs, *pixd, *pixt;
#   50|   l_float32  pops;
#   51|   char      *filein, *fileout;

Error: COMPILER_WARNING (CWE-563): [#def20]
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotateorthtest1.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotateorthtest1.c:50:12: warning[-Wunused-variable]: unused variable ‘pops’
#   50 | l_float32  pops;
#      |            ^~~~
#   48|   l_int32    dir;
#   49|   PIX       *pixs, *pixd, *pixt;
#   50|-> l_float32  pops;
#   51|   char      *filein, *fileout;
#   52|   

Error: COMPILER_WARNING (CWE-563): [#def21]
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotatetest1.c:43:12: warning[-Wunused-but-set-variable]: variable ‘angle’ set but not used
#   43 | l_float32  angle, deg2rad, ang;
#      |            ^~~~~
#   41|   l_int32    i, w, h, d, rotflag;
#   42|   PIX       *pixs, *pixt, *pixd;
#   43|-> l_float32  angle, deg2rad, ang;
#   44|   char      *filein, *fileout;
#   45|   

Error: COMPILER_WARNING (CWE-563): [#def22]
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotatetest1.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/rotatetest1.c:44:21: warning[-Wunused-but-set-variable]: variable ‘fileout’ set but not used
#   44 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   42|   PIX       *pixs, *pixt, *pixd;
#   43|   l_float32  angle, deg2rad, ang;
#   44|-> char      *filein, *fileout;
#   45|   
#   46|       if (argc != 4)

Error: COMPILER_WARNING (CWE-563): [#def23]
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c:48:21: warning[-Wunused-but-set-variable]: variable ‘fileout’ set but not used
#   48 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   46|            char **argv)
#   47|   {
#   48|-> char      *filein, *fileout;
#   49|   l_int32    i;
#   50|   l_uint32   val;

Error: COMPILER_WARNING (CWE-563): [#def24]
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c:51:12: warning[-Wunused-but-set-variable]: variable ‘size’ set but not used
#   51 | l_float32  size;
#      |            ^~~~
#   49|   l_int32    i;
#   50|   l_uint32   val;
#   51|-> l_float32  size;
#   52|   PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   

Error: COMPILER_WARNING (CWE-563): [#def25]
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c:52:41: warning[-Wunused-variable]: unused variable ‘pixt1’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                         ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING (CWE-563): [#def26]
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c:52:49: warning[-Wunused-variable]: unused variable ‘pixt2’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                                 ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING (CWE-563): [#def27]
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/seedfilltest.c:52:57: warning[-Wunused-variable]: unused variable ‘pixt3’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                                         ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING (CWE-563): [#def28]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:46:21: warning[-Wunused-but-set-variable]: variable ‘fileout’ set but not used
#   46 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   44|            char **argv)
#   45|   {
#   46|-> char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;

Error: COMPILER_WARNING (CWE-563): [#def29]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:47:12: warning[-Wunused-variable]: unused variable ‘i’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |            ^
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING (CWE-563): [#def30]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:47:21: warning[-Wunused-variable]: unused variable ‘liney’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |                     ^~~~~
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING (CWE-563): [#def31]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:47:28: warning[-Wunused-variable]: unused variable ‘linex’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |                            ^~~~~
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING (CWE-563): [#def32]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:48:12: warning[-Wunused-but-set-variable]: variable ‘angle’ set but not used
#   48 | l_float32  angle, deg2rad;
#      |            ^~~~~
#   46|   char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|-> l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   

Error: COMPILER_WARNING (CWE-563): [#def33]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:48:19: warning[-Wunused-but-set-variable]: variable ‘deg2rad’ set but not used
#   48 | l_float32  angle, deg2rad;
#      |                   ^~~~~~~
#   46|   char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|-> l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   

Error: COMPILER_WARNING (CWE-563): [#def34]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/sheartest.c:49:35: warning[-Wunused-variable]: unused variable ‘pixd’
#   49 | PIX       *pixt1, *pixt2, *pixs, *pixd;
#      |                                   ^~~~
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|-> PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   
#   51|       if (argc != 4)

Error: COMPILER_WARNING (CWE-563): [#def35]
leptonica-1.85.0-build/leptonica-1.85.0/prog/sorttest.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/sorttest.c:45:10: warning[-Wunused-variable]: unused variable ‘i’
#   45 | l_int32  i, n, ns;
#      |          ^
#   43|   {
#   44|   char    *filein;
#   45|-> l_int32  i, n, ns;
#   46|   BOXA    *boxa;
#   47|   PIX     *pixs, *pixt;

Error: COMPILER_WARNING (CWE-563): [#def36]
leptonica-1.85.0-build/leptonica-1.85.0/prog/warpertest.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/warpertest.c:56:27: warning[-Wunused-but-set-variable]: variable ‘index’ set but not used
#   56 | l_int32    w, h, i, j, k, index, op, dir, stretch;
#      |                           ^~~~~
#   54|   {
#   55|   char       buf[256];
#   56|-> l_int32    w, h, i, j, k, index, op, dir, stretch;
#   57|   l_float32  del, angle, angledeg;
#   58|   BOX       *box;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c: scope_hint: In function ‘iaaGetLinearTRC’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2907:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ia’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2903:21: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2903:21: note: in expansion of macro ‘LEPT_CALLOC’
# 2905|       if (diff == 0) {  /* shouldn't happen */
# 2906|           for (i = 0; i < 256; i++)
# 2907|->             ia[i] = 128;
# 2908|       }
# 2909|       else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2912:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ia’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2903:21: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2903:21: note: in expansion of macro ‘LEPT_CALLOC’
# 2910|           factor = 255. / (l_float32)diff;
# 2911|           for (i = 0; i < diff + 1; i++)
# 2912|->             ia[i] = (l_int32)(factor * i + 0.5);
# 2913|           for (i = diff + 1; i < 256; i++)
# 2914|               ia[i] = 255;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c: scope_hint: In function ‘getAffineXformCoeffs’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:943:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[0]’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:240: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  941|       for (i = 0; i < 6; i++)
#  942|           a[i] = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));
#  943|->     a[0][0] = x1;
#  944|       a[0][1] = y1;
#  945|       a[0][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:946:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[1]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  944|       a[0][1] = y1;
#  945|       a[0][2] = 1.;
#  946|->     a[1][3] = x1;
#  947|       a[1][4] = y1;
#  948|       a[1][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:949:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[2]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  947|       a[1][4] = y1;
#  948|       a[1][5] = 1.;
#  949|->     a[2][0] = x2;
#  950|       a[2][1] = y2;
#  951|       a[2][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:952:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[3]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  950|       a[2][1] = y2;
#  951|       a[2][2] = 1.;
#  952|->     a[3][3] = x2;
#  953|       a[3][4] = y2;
#  954|       a[3][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:955:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[4]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  953|       a[3][4] = y2;
#  954|       a[3][5] = 1.;
#  955|->     a[4][0] = x3;
#  956|       a[4][1] = y3;
#  957|       a[4][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:958:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[5]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:931:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:942:29: note: in expansion of macro ‘LEPT_CALLOC’
#  956|       a[4][1] = y3;
#  957|       a[4][2] = 1.;
#  958|->     a[5][3] = x3;
#  959|       a[5][4] = y3;
#  960|       a[5][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c: scope_hint: In function ‘affineInvertXform’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1020:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[0]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1018|       for (i = 0; i < 3; i++)
# 1019|           a[i] = (l_float32 *)LEPT_CALLOC(3, sizeof(l_float32));
# 1020|->     a[0][0] = vc[0];
# 1021|       a[0][1] = vc[1];
# 1022|       a[0][2] = vc[2];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1023:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[1]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1021|       a[0][1] = vc[1];
# 1022|       a[0][2] = vc[2];
# 1023|->     a[1][0] = vc[3];
# 1024|       a[1][1] = vc[4];
# 1025|       a[1][2] = vc[5];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1026:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[2]’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1024|       a[1][1] = vc[4];
# 1025|       a[1][2] = vc[5];
# 1026|->     a[2][2] = 1.0;
# 1027|       gaussjordan(a, b, 3);  /* this inverts matrix a */
# 1028|       vci = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1030:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘vci’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1019:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1328:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:593:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1332:9: note: in expansion of macro ‘L_ERROR’
leptonica-1.85.0-build/leptonica-1.85.0/src/affine.c:1028:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1028|       vci = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));
# 1029|       *pvci = vci;
# 1030|->     vci[0] = a[0][0];
# 1031|       vci[1] = a[0][1];
# 1032|       vci[2] = a[0][2];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c: scope_hint: In function ‘createMatrix2dTranslate’
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:99:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mat’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:63: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:98:24: note: in expansion of macro ‘LEPT_CALLOC’
#   97|   
#   98|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#   99|->     mat[0] = mat[4] = mat[8] = 1;
#  100|       mat[2] = transx;
#  101|       mat[5] = transy;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def50]
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c: scope_hint: In function ‘createMatrix2dScale’
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:136:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mat’
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:135:24: note: in expansion of macro ‘LEPT_CALLOC’
#  134|   
#  135|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#  136|->     mat[0] = scalex;
#  137|       mat[4] = scaley;
#  138|       mat[8] = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c: scope_hint: In function ‘createMatrix2dRotate’
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:189:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mat’
leptonica-1.85.0-build/leptonica-1.85.0/src/affinecompose.c:186:24: note: in expansion of macro ‘LEPT_CALLOC’
#  187|       sina = sin(angle);
#  188|       cosa = cos(angle);
#  189|->     mat[0] = mat[4] = cosa;
#  190|       mat[1] = -sina;
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecode2of5’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:414:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:67: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:401:20: note: in expansion of macro ‘LEPT_CALLOC’
#  412|           for (j = 0; j < 10; j++) {
#  413|               if (!strcmp(code, Code2of5[j])) {
#  414|->                 data[i] = 0x30 + j;
#  415|                   found = TRUE;
#  416|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecodeI2of5’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:495:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:479:20: note: in expansion of macro ‘LEPT_CALLOC’
#  493|           for (j = 0; j < 10; j++) {
#  494|               if (!strcmp(code1, CodeI2of5[j])) {
#  495|->                 data[2 * i] = 0x30 + j;
#  496|                   found = TRUE;
#  497|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecode93’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:591:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:576:20: note: in expansion of macro ‘LEPT_CALLOC’
#  589|           for (j = 0; j < C93_START; j++) {
#  590|               if (!strcmp(code, Code93[j])) {
#  591|->                 data[i] = Code93Val[j];
#  592|                   index[i] = j;
#  593|                   found = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:592:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘index’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:577:24: note: in expansion of macro ‘LEPT_CALLOC’
#  590|               if (!strcmp(code, Code93[j])) {
#  591|                   data[i] = Code93Val[j];
#  592|->                 index[i] = j;
#  593|                   found = TRUE;
#  594|                   break;

Error: GCC_ANALYZER_WARNING (CWE-122): [#def56]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:613:13: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:576:20: note: in expansion of macro ‘LEPT_CALLOC’
#  611|       for (i = 0; i < nsymb - 2; i++)  /* skip the "C" and "K" */
#  612|           sum += ((i % 20) + 1) * index[nsymb - 3 - i];
#  613|->     if (data[nsymb - 2] != Code93Val[sum % 47])
#  614|           L_WARNING("Error for check C\n", __func__);
#  615|   

Error: GCC_ANALYZER_WARNING (CWE-122): [#def57]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:633:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:576:20: note: in expansion of macro ‘LEPT_CALLOC’
#  631|   
#  632|           /* Remove the two check codes from the output */
#  633|->     data[nsymb - 2] = '\0';
#  634|   
#  635|       LEPT_FREE(index);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def58]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecode39’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:703:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:689:20: note: in expansion of macro ‘LEPT_CALLOC’
#  701|           for (j = 0; j < C39_START; j++) {
#  702|               if (!strcmp(code, Code39[j])) {
#  703|->                 data[i] = Code39Val[j];
#  704|                   found = TRUE;
#  705|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def59]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecodeCodabar’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:785:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:771:20: note: in expansion of macro ‘LEPT_CALLOC’
#  783|           for (j = 0; j < 16; j++) {
#  784|               if (!strcmp(code, Codabar[j])) {
#  785|->                 data[i] = CodabarVal[j];
#  786|                   found = TRUE;
#  787|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def60]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecodeUpca’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:882:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:865:20: note: in expansion of macro ‘LEPT_CALLOC’
#  880|           for (j = 0; j < 10; j++) {
#  881|               if (!strcmp(code, Upca[j])) {
#  882|->                 data[i] = 0x30 + j;
#  883|                   found = TRUE;
#  884|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:899:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:865:20: note: in expansion of macro ‘LEPT_CALLOC’
#  897|       sum = 0;
#  898|       for (i = 0; i < 12; i += 2)  /* "even" digits */
#  899|->         sum += 3 * (data[i] - 0x30);
#  900|       for (i = 1; i < 11; i += 2)  /* "odd" digits */
#  901|           sum += (data[i] - 0x30);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def62]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c: scope_hint: In function ‘barcodeDecodeEan13’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:1000:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:983:20: note: in expansion of macro ‘LEPT_CALLOC’
#  998|           for (j = 0; j < 10; j++) {
#  999|               if (!strcmp(code, Upca[j])) {
# 1000|->                 data[i] = 0x30 + j;
# 1001|                   found = TRUE;
# 1002|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:1017:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:983:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1015|       sum = 0;
# 1016|       for (i = 0; i < 12; i += 2)  /* "even" digits */
# 1017|->         sum += 3 * (data[i] - 0x30);
# 1018|       for (i = 1; i < 12; i += 2)  /* "odd" digits */
# 1019|           sum += (data[i] - 0x30);

Error: CPPCHECK_WARNING (CWE-457): [#def64]
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:445: warning[uninitvar]: Uninitialized variable: dely
#  443|       }
#  444|       ptaAddPt(ptas, 0, i);
#  445|->     ptaAddPt(ptas, w - 1, i - dely);
#  446|       ptaAddPt(ptad, 0, i);
#  447|       ptaAddPt(ptad, w - 1, i);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def65]
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c: scope_hint: In function ‘pixGetLocalSkewTransform’
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:445:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dely’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:55: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:528:24: note: in expansion of macro ‘ERROR_PTR’
#  443|       }
#  444|       ptaAddPt(ptas, 0, i);
#  445|->     ptaAddPt(ptas, w - 1, i - dely);
#  446|       ptaAddPt(ptad, 0, i);
#  447|       ptaAddPt(ptad, w - 1, i);

Error: COMPILER_WARNING (CWE-457): [#def66]
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c: scope_hint: In function ‘pixGetLocalSkewTransform’
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:445:5: warning[-Wmaybe-uninitialized]: ‘dely’ may be used uninitialized
#  445 |     ptaAddPt(ptas, w - 1, i - dely);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/baseline.c:400:33: note: ‘dely’ was declared here
#  400 | l_float32  deg2rad, angr, angd, dely;
#      |                                 ^~~~
#  443|       }
#  444|       ptaAddPt(ptas, 0, i);
#  445|->     ptaAddPt(ptas, w - 1, i - dely);
#  446|       ptaAddPt(ptad, 0, i);
#  447|       ptaAddPt(ptad, w - 1, i);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
leptonica-1.85.0-build/leptonica-1.85.0/src/bbuffer.c: scope_hint: In function ‘bbufferCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/bbuffer.c:139:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bb’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bbuffer.c:105: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bbuffer.c:138:23: note: in expansion of macro ‘LEPT_CALLOC’
#  137|   
#  138|       bb = (L_BBUFFER *)LEPT_CALLOC(1, sizeof(L_BBUFFER));
#  139|->     if ((bb->array = (l_uint8 *)LEPT_CALLOC(nalloc, sizeof(l_uint8))) == NULL) {
#  140|           LEPT_FREE(bb);
#  141|           return (L_BBUFFER *)ERROR_PTR("byte array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c: scope_hint: In function ‘bilateralCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:330:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bil’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:81: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
#  328|   
#  329|       bil = (L_BILATERAL *)LEPT_CALLOC(1, sizeof(L_BILATERAL));
#  330|->     bil->spatial_stdev = sstdev;
#  331|       bil->range_stdev = range_stdev;
#  332|       bil->reduction = reduction;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def69]
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:348:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nc’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:346:21: note: in expansion of macro ‘LEPT_CALLOC’
#  346|       nc = (l_int32 *)LEPT_CALLOC(ncomps, sizeof(l_int32));
#  347|       for (i = 0; i < ncomps; i++)
#  348|->         nc[i] = minval + i * (maxval - minval) / (ncomps - 1);
#  349|       bil->nc = nc;
#  350|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:391:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘spatial’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:388:28: note: in expansion of macro ‘LEPT_CALLOC’
#  389|       denom = 2. * sstdev * sstdev;
#  390|       for (i = 0; i < spatial_size; i++)
#  391|->         spatial[i] = expf(-(l_float32)(i * i) / denom);
#  392|       bil->spatial = spatial;
#  393|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def71]
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:397:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘range’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:394:26: note: in expansion of macro ‘LEPT_CALLOC’
#  395|       denom = 2. * range_stdev * range_stdev;
#  396|       for (i = 0; i < 256; i++)
#  397|->         range[i] = expf(-(l_float32)(i * i) / denom);
#  398|       bil->range = range;
#  399|   

Error: COMPILER_WARNING (CWE-457): [#def72]
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c: scope_hint: In function ‘pixSauvolaBinarize’
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c:716:47: warning[-Wmaybe-uninitialized]: ‘wplsd’ may be used uninitialized
#  716 | l_int32     i, j, w, h, tabsize, wplm, wplms, wplsd, wpld, usetab;
#      |                                               ^~~~~
#  714|                          PIX      **ppixsd)
#  715|   {
#  716|-> l_int32     i, j, w, h, tabsize, wplm, wplms, wplsd, wpld, usetab;
#  717|   l_int32     mv, ms, var, thresh;
#  718|   l_uint32   *datam, *datams, *datasd = NULL, *datad;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def73]
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c: scope_hint: In function ‘pixSauvolaGetThreshold’
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c:743:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c:92: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c:741:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/binarize.c:741:28: note: in expansion of macro ‘LEPT_CALLOC’
#  741|           tab = (l_float32 *)LEPT_CALLOC(tabsize, sizeof(l_float32));
#  742|           for (i = 0; i < tabsize; i++)
#  743|->             tab[i] = sqrtf((l_float32)i);
#  744|       }
#  745|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
leptonica-1.85.0-build/leptonica-1.85.0/src/binreduce.c: scope_hint: In function ‘makeSubsampleTab2x’
leptonica-1.85.0-build/leptonica-1.85.0/src/binreduce.c:392:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/binreduce.c:48: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/binreduce.c:390:23: note: in expansion of macro ‘LEPT_CALLOC’
#  390|       tab = (l_uint8 *) LEPT_CALLOC(256, sizeof(l_uint8));
#  391|       for (i = 0; i < 256; i++) {
#  392|->         tab[i] = ((i & 0x01)     ) |    /* 7 */
#  393|                    ((i & 0x04) >> 1) |    /* 6 */
#  394|                    ((i & 0x10) >> 2) |    /* 5 */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def75]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/blend.c:151: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/blend.c: scope_hint: In function ‘pixLinearEdgeFade’
leptonica-1.85.0-build/leptonica-1.85.0/src/blend.c:2227:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘xmin’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:70: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:70: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:70: note: in definition of macro ‘GET_DATA_BYTE’
# 2225|                   line = data + i * wpl;
# 2226|                   if (d == 8) {
# 2227|->                     val = GET_DATA_BYTE(line, xmin + j);
# 2228|                       val += (limit - val) * del + 0.5;
# 2229|                       SET_DATA_BYTE(line, xmin + j, val);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def76]
leptonica-1.85.0-build/leptonica-1.85.0/src/blend.c:2231:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘xmin’
# 2229|                       SET_DATA_BYTE(line, xmin + j, val);
# 2230|                   } else {  /* rgb */
# 2231|->                     extractRGBValues(*(line + xmin + j), &rval, &gval, &bval);
# 2232|                       rval += (limit - rval) * del + 0.5;
# 2233|                       gval += (limit - gval) * del + 0.5;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def77]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c: scope_hint: In function ‘pixaGenerateFont’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:583:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘top’
#  581|           } else if (inrow && ia[i] == 0) {
#  582|               inrow = 0;
#  583|->             box = boxCreate(0, top, w, i - top);
#  584|               boxaAddBox(boxar, box, L_INSERT);
#  585|           }

Error: COMPILER_WARNING (CWE-457): [#def78]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c: scope_hint: In function ‘pixaGenerateFont’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:610:21: warning[-Wmaybe-uninitialized]: ‘yval’ may be used uninitialized
#  610 |         baseline[i] = yval;
#      |         ~~~~~~~~~~~~^~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:552:46: note: ‘yval’ was declared here
#  552 | l_int32   i, j, nrows, nrowchars, nchars, h, yval;
#      |                                              ^~~~
#  608|           pixr = pixClipRectangle(pixs, box, NULL);  /* row of chars */
#  609|           pixGetTextBaseline(pixr, tab, &yval);
#  610|->         baseline[i] = yval;
#  611|   
#  612|   #if DEBUG_BASELINE

Error: GCC_ANALYZER_WARNING (CWE-476): [#def79]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c: scope_hint: In function ‘bmfMakeAsciiTables’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:798:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fonttab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:74: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:795:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmf.c:795:26: note: in expansion of macro ‘LEPT_CALLOC’
#  796|       bmf->fonttab = fonttab;
#  797|       for (i = 0; i < 128; i++)
#  798|->         fonttab[i] = UNDEF;
#  799|       for (i = 32; i < 127; i++)
#  800|           fonttab[i] = i - 32;

Error: COMPILER_WARNING (CWE-563): [#def80]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmfdata.h:50:21: warning[-Wunused-variable]: ‘inputfonts’ defined but not used
#   50 | static const char  *inputfonts[] = {"chars-4.tif", "chars-6.tif",
#      |                     ^~~~~~~~~~
#   48|   
#   49|   #define  NUM_FONTS  9
#   50|-> static const char  *inputfonts[] = {"chars-4.tif", "chars-6.tif",
#   51|                                       "chars-8.tif", "chars-10.tif",
#   52|                                       "chars-12.tif", "chars-14.tif",

Error: COMPILER_WARNING (CWE-563): [#def81]
leptonica-1.85.0-build/leptonica-1.85.0/prog/recog_bootnum1.c:62: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmfdata.h:55:21: warning[-Wunused-variable]: ‘outputfonts’ defined but not used
#   55 | static const char  *outputfonts[] = {"chars-4.pa", "chars-6.pa",
#      |                     ^~~~~~~~~~~
#   53|                                       "chars-16.tif", "chars-18.tif",
#   54|                                       "chars-20.tif"};
#   55|-> static const char  *outputfonts[] = {"chars-4.pa", "chars-6.pa",
#   56|                                        "chars-8.pa", "chars-10.pa",
#   57|                                        "chars-12.pa", "chars-14.pa",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c: scope_hint: In function ‘pixReadMemBmp’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:150:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cmapBuf’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:47: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:255:35: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:255:35: note: in expansion of macro ‘LEPT_CALLOC’
#  148|   
#  149|       if (!cdata)
#  150|->         return (PIX *)ERROR_PTR("cdata not defined", __func__, NULL);
#  151|       if (size < sizeof(BMP_FH) + sizeof(BMP_IH))
#  152|           return (PIX *)ERROR_PTR("bmf size error", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def83]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c: scope_hint: In function ‘pixWriteStreamBmp’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:423:14: warning[-Wanalyzer-null-argument]: use of NULL ‘data’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:31: included_from: Included from here.
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  421|       pixWriteMemBmp(&data, &size, pix);
#  422|       rewind(fp);
#  423|->     nbytes = fwrite(data, 1, size, fp);
#  424|       free(data);
#  425|       if (nbytes != size) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def84]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:423:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:573:24: note: in expansion of macro ‘LEPT_CALLOC’
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  421|       pixWriteMemBmp(&data, &size, pix);
#  422|       rewind(fp);
#  423|->     nbytes = fwrite(data, 1, size, fp);
#  424|       free(data);
#  425|       if (nbytes != size) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def85]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:554:57: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pquad’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:549:30: note: in expansion of macro ‘LEPT_CALLOC’
#  552|                    i < ncolors;
#  553|                    i++, val += stepsize, pquad++) {
#  554|->                 pquad->blue = pquad->green = pquad->red = val;
#  555|                   pquad->alpha = 255;  /* opaque */
#  556|               }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def86]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:650:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&pel’
#  648|                   if (spp == 4)
#  649|                       pel[3] = *((l_uint8 *)pword + L_ALPHA_CHANNEL);
#  650|->                 memcpy(fmdata, &pel, spp);
#  651|                   fmdata += spp;
#  652|               }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def87]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:655:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(unsigned char *)(&pel[0])’
#  653|               if (extrabytes) {
#  654|                   for (k = 0; k < extrabytes; k++) {
#  655|->                     memcpy(fmdata, &pel, 1);
#  656|                       fmdata++;
#  657|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c: scope_hint: In function ‘boxaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:450:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘boxa’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:137: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:449:20: note: in expansion of macro ‘LEPT_CALLOC’
#  448|   
#  449|       boxa = (BOXA *)LEPT_CALLOC(1, sizeof(BOXA));
#  450|->     boxa->n = 0;
#  451|       boxa->nalloc = n;
#  452|       boxa->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c: scope_hint: In function ‘boxaRemoveBoxAndSave.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:999:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘boxa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:707:23: note: in expansion of macro ‘ERROR_PTR’
#  997|       if (pbox)
#  998|           *pbox = boxaGetBox(boxa, index, L_CLONE);
#  999|->     array = boxa->box;
# 1000|       boxDestroy(&array[index]);
# 1001|       for (i = index + 1; i < n; i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c: scope_hint: In function ‘boxaaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:1153:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘baa’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxbasic.c:1152:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1151|   
# 1152|       baa = (BOXAA *)LEPT_CALLOC(1, sizeof(BOXAA));
# 1153|->     if ((baa->boxa = (BOXA **)LEPT_CALLOC(n, sizeof(BOXA *))) == NULL) {
# 1154|           boxaaDestroy(&baa);
# 1155|           return (BOXAA *)ERROR_PTR("boxa ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def91]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:72: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c: scope_hint: In function ‘boxTransformOrdered’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:332:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  330|               xdif = tx + 0.5 * tw - xcent;
#  331|               ydif = ty + 0.5 * th - ycent;
#  332|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  333|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  334|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def92]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:351:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  349|               xdif = tx + 0.5 * tw - xcent;
#  350|               ydif = ty + 0.5 * th - ycent;
#  351|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  352|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  353|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def93]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:367:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  365|               xdif = bx + 0.5 * bw - xcen;
#  366|               ydif = by + 0.5 * bh - ycen;
#  367|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  368|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  369|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def94]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:386:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  384|               xdif = bx + 0.5 * bw - xcen;
#  385|               ydif = by + 0.5 * bh - ycen;
#  386|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  387|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  388|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def95]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:407:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  405|               xdif = tx + 0.5 * bw - xcen;
#  406|               ydif = ty + 0.5 * bh - ycen;
#  407|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  408|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  409|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def96]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:432:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:25: note: in definition of macro ‘L_ABS’
#  430|               xdif = tx + 0.5 * tw - xcent;
#  431|               ydif = ty + 0.5 * th - ycent;
#  432|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  433|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  434|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: CPPCHECK_WARNING (CWE-457): [#def97]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1807: warning[uninitvar]: Uninitialized variable: nbox
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def98]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c: scope_hint: In function ‘boxaaTranspose’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1807:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbox’
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: COMPILER_WARNING (CWE-457): [#def99]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c: scope_hint: In function ‘boxaaTranspose’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1807:12: warning[-Wmaybe-uninitialized]: ‘nbox’ may be used uninitialized
# 1807 |     baad = boxaaCreate(nbox);
#      |            ^~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1783:25: note: ‘nbox’ was declared here
# 1783 | l_int32   i, j, ny, nb, nbox;
#      |                         ^~~~
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def100]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c: scope_hint: In function ‘boxaaAlignBox’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1882:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘maxindex’
# 1880|   
# 1881|       if (maxovlp + delta >= 0)
# 1882|->         *pindex = maxindex;
# 1883|       else
# 1884|           *pindex = n;

Error: COMPILER_WARNING (CWE-457): [#def101]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c: scope_hint: In function ‘boxaaAlignBox’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1882:17: warning[-Wmaybe-uninitialized]: ‘maxindex’ may be used uninitialized
# 1882 |         *pindex = maxindex;
#      |         ~~~~~~~~^~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc2.c:1843:48: note: ‘maxindex’ was declared here
# 1843 | l_int32  i, n, m, y, yt, h, ht, ovlp, maxovlp, maxindex;
#      |                                                ^~~~~~~~
# 1880|   
# 1881|       if (maxovlp + delta >= 0)
# 1882|->         *pindex = maxindex;
# 1883|       else
# 1884|           *pindex = n;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def102]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c:67: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c: scope_hint: In function ‘pixSearchForRectangle’
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c:1107:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countref’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
# 1105|                    * with the score. */
# 1106|               if (atref) {
# 1107|->                 diff = L_ABS(colsum - countref);
# 1108|                   if (diff >= delta || x == bx + bw - 1) {
# 1109|                       height = maxval - minval + 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def103]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c:1148:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countref’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
# 1146|               }
# 1147|               if (atref) {
# 1148|->                 diff = L_ABS(colsum - countref);
# 1149|                   if (diff >= delta || x == bx) {
# 1150|                       height = maxval - minval + 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def104]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c:1190:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countref’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
# 1188|               }
# 1189|               if (atref) {
# 1190|->                 diff = L_ABS(rowsum - countref);
# 1191|                   if (diff >= delta || y == by + bh - 1) {
# 1192|                       width = maxval - minval + 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def105]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc3.c:1231:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countref’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
# 1229|               }
# 1230|               if (atref) {
# 1231|->                 diff = L_ABS(rowsum - countref);
# 1232|                   if (diff >= delta || y == by) {
# 1233|                       width = maxval - minval + 1;

Error: CPPCHECK_WARNING (CWE-457): [#def106]
leptonica-1.85.0-build/leptonica-1.85.0/src/boxfunc5.c:649: warning[uninitvar]: Uninitialized variable: fvarm
#  647|   
#  648|           /* Make decision */
#  649|->     if (fvarp < threshp && fvarm < threshm)
#  650|           *psame = 1;
#  651|       else if (fvarp < threshp && fvarm > threshm)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def107]
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c: scope_hint: In function ‘l_byteaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c:105:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ba’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c:72: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c:104:21: note: in expansion of macro ‘LEPT_CALLOC’
#  103|           nbytes = InitialArraySize;
#  104|       ba = (L_BYTEA *)LEPT_CALLOC(1, sizeof(L_BYTEA));
#  105|->     ba->data = (l_uint8 *)LEPT_CALLOC(nbytes + 1, sizeof(l_uint8));
#  106|       if (!ba->data) {
#  107|           l_byteaDestroy(&ba);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c: scope_hint: In function ‘l_byteaDestroy’
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c:259:10: warning[-Wanalyzer-malloc-leak]: leak of ‘ba’
leptonica-1.85.0-build/leptonica-1.85.0/src/bytearray.c:104:21: note: in expansion of macro ‘LEPT_CALLOC’
#  257|           LEPT_FREE(ba);
#  258|       }
#  259|->     *pba = NULL;
#  260|   }
#  261|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def109]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:333:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccba’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:255: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:327:23: note: in expansion of macro ‘LEPT_CALLOC’
#  331|           ccba->h = pixGetHeight(pixs);
#  332|       }
#  333|->     ccba->n = 0;
#  334|       ccba->nalloc = n;
#  335|       if ((ccba->ccb = (CCBORD **)LEPT_CALLOC(n, sizeof(CCBORD *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:390:19: warning[-Wanalyzer-malloc-leak]: leak of ‘ccbCreate.part.0(0)’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:337:27: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:389:21: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:492:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:469:20: note: in expansion of macro ‘ERROR_INT’
#  388|   
#  389|       ccb = (CCBORD *)LEPT_CALLOC(1, sizeof(CCBORD));
#  390|->     ccb->refcount = 1;
#  391|       if (pixs)
#  392|           ccb->pix = pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbCreate.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:392:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccb’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:389:21: note: in expansion of macro ‘LEPT_CALLOC’
#  390|       ccb->refcount = 1;
#  391|       if (pixs)
#  392|->         ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:394:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccb’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:389:21: note: in expansion of macro ‘LEPT_CALLOC’
#  392|           ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|->     ccb->boxa = boxa;
#  395|       start = ptaCreate(1);
#  396|       ccb->start = start;

Error: COMPILER_WARNING (CWE-457): [#def113]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:720:16: warning[-Wmaybe-uninitialized]: ‘xh’ may be used uninitialized
#  720 |         for (x = xh + boxt->x; x < w; x++) {  /* look for (fg) border pixel */
#      |              ~~^~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘pixGetAllCCBorders’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:647:26: note: ‘xh’ was declared here
#  647 | l_int32   allzero, i, x, xh, w, nh;
#      |                          ^~
#  718|               continue;
#  719|           }
#  720|->         for (x = xh + boxt->x; x < w; x++) {  /* look for (fg) border pixel */
#  721|               pixGetPixel(pixs, x, ys, &val);
#  722|               if (val == 1) {

Error: COMPILER_WARNING (CWE-457): [#def114]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1007:9: warning[-Wmaybe-uninitialized]: ‘xs’ may be used uninitialized
# 1007 |     if (findNextBorderPixel(w, h, data, wpl, xs, ys, &qpos, &npx, &npy))
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘pixGetAllCCBorders’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:648:11: note: ‘xs’ was declared here
#  648 | l_int32   xs, ys;   /* starting hole border pixel, relative in pixs */
#      |           ^~
# 1005|           /* Get the second point; there should always be at least 4 pts
# 1006|            * in a minimal hole border!  */
# 1007|->     if (findNextBorderPixel(w, h, data, wpl, xs, ys, &qpos, &npx, &npy))
# 1008|           return ERROR_INT("isolated hole border point!", __func__, 1);
# 1009|   

Error: COMPILER_WARNING (CWE-457): [#def115]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1110:8: warning[-Wmaybe-uninitialized]: ‘fpx’ may be used uninitialized
# 1110 |     dx = spx - fpx;
#      |     ~~~^~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1962:10: note: ‘fpx’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |          ^~~
# 1108|   l_int32  dx, dy;
# 1109|   
# 1110|->     dx = spx - fpx;
# 1111|       dy = spy - fpy;
# 1112|   

Error: COMPILER_WARNING (CWE-457): [#def116]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1110:8: warning[-Wmaybe-uninitialized]: ‘spx’ may be used uninitialized
# 1110 |     dx = spx - fpx;
#      |     ~~~^~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1962:20: note: ‘spx’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |                    ^~~
# 1108|   l_int32  dx, dy;
# 1109|   
# 1110|->     dx = spx - fpx;
# 1111|       dy = spy - fpy;
# 1112|   

Error: COMPILER_WARNING (CWE-457): [#def117]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1111:8: warning[-Wmaybe-uninitialized]: ‘fpy’ may be used uninitialized
# 1111 |     dy = spy - fpy;
#      |     ~~~^~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1962:15: note: ‘fpy’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |               ^~~
# 1109|   
# 1110|       dx = spx - fpx;
# 1111|->     dy = spy - fpy;
# 1112|   
# 1113|       if (dx * dy == 1) {

Error: COMPILER_WARNING (CWE-457): [#def118]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1111:8: warning[-Wmaybe-uninitialized]: ‘spy’ may be used uninitialized
# 1111 |     dy = spy - fpy;
#      |     ~~~^~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1962:25: note: ‘spy’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |                         ^~~
# 1109|   
# 1110|       dx = spx - fpx;
# 1111|->     dy = spy - fpy;
# 1112|   
# 1113|       if (dx * dy == 1) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaGenerateStepChains’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1238:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ccb’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaGenerateStepChains’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaGenerateStepChains’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:541:26: note: in expansion of macro ‘ERROR_PTR’
# 1236|   
# 1237|               /* Make a new step numaa, removing any old one */
# 1238|->         ptaal = ccb->local;
# 1239|           nb = ptaaGetCount(ptaal);  /* number of borders */
# 1240|           if (ccb->step)  /* remove old one */

Error: COMPILER_WARNING (CWE-457): [#def120]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaGenerateSinglePath’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1575:16: warning[-Wmaybe-uninitialized]: ‘len’ may be used uninitialized
# 1575 |             if (len == 0) {  /* lost the hole */
#      |                ^
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:1522:45: note: ‘len’ was declared here
# 1522 | l_int32   i, j, k, ncc, nb, ncut, npt, dir, len, state, lostholes;
#      |                                             ^~~
# 1573|                   /* Find a short path and store it */
# 1574|               ptac = getCutPathForHole(ccb->pix, pta, boxinner, &dir, &len);
# 1575|->             if (len == 0) {  /* lost the hole */
# 1576|                   lostholes++;
# 1577|   /*                boxPrintStreamInfo(stderr, boxa->box[0]); */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage2’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:2108:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ccb’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage2’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:597:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:2125:13: note: in expansion of macro ‘L_WARNING’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:541:26: note: in expansion of macro ‘ERROR_PTR’
# 2106|                * from one seed for each closed border. */
# 2107|           ccb = ccbaGetCcb(ccba, i);
# 2108|->         if ((boxa = ccb->boxa) == NULL) {
# 2109|               pixDestroy(&pixd);
# 2110|               ccbDestroy(&ccb);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaWriteStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:2270:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ccb’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c: scope_hint: In function ‘ccbaWriteStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ccbord.c:541:26: note: in expansion of macro ‘ERROR_PTR’
# 2268|       for (i = 0; i < ncc; i++) {
# 2269|           ccb = ccbaGetCcb(ccba, i);
# 2270|->         if (boxaGetBoxGeometry(ccb->boxa, 0, &bx, &by, &bw, &bh)) {
# 2271|               bbufferDestroy(&bbuf);
# 2272|               ccbDestroy(&ccb);

Error: COMPILER_WARNING (CWE-457): [#def123]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c: scope_hint: In function ‘pixColorContent’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:211:30: warning[-Wmaybe-uninitialized]: ‘wplr’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                              ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: COMPILER_WARNING (CWE-457): [#def124]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:211:36: warning[-Wmaybe-uninitialized]: ‘wplg’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                                    ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: COMPILER_WARNING (CWE-457): [#def125]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:211:42: warning[-Wmaybe-uninitialized]: ‘wplb’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                                          ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def126]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c: scope_hint: In function ‘pixNumColors’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:1451:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘inta’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:155: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:1437:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorcontent.c:1437:27: note: in expansion of macro ‘LEPT_CALLOC’
# 1449|           }
# 1450|           for (i = 0; i < 256; i++)
# 1451|->             if (inta[i]) sum++;
# 1452|           *pncolors = sum;
# 1453|           LEPT_FREE(inta);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorfill.c:498:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘el’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorfill.c: scope_hint: In function ‘pixColorFillFromSeed’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorfill.c:497:21: note: in expansion of macro ‘LEPT_CALLOC’
#  496|   
#  497|       el = (COLOREL *)LEPT_CALLOC(1, sizeof(COLOREL));
#  498|->     el->x = x;
#  499|       el->y = y;
#  500|       el->color = color;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def128]
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c: scope_hint: In function ‘pixSnapColorCmap.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:625:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:98: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:619:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  623|               (L_ABS(gval - gsval) <= diff) &&
#  624|               (L_ABS(bval - bsval) <= diff))
#  625|->             tab[i] = 1;
#  626|       }
#  627|       pixm = pixMakeMaskFromLUT(pixd, tab);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:689:16: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:704:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:706:23: note: in expansion of macro ‘ERROR_PTR’
#  687|   
#  688|       if (!pixs || pixGetDepth(pixs) != 32)
#  689|->         return (PIX *)ERROR_PTR("pixs undefined or not 32 bpp", __func__, pixd);
#  690|       if (pixd && (pixd != pixs))
#  691|           return (PIX *)ERROR_PTR("pixd exists, but != pixs", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:689:16: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:703:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:706:23: note: in expansion of macro ‘ERROR_PTR’
#  687|   
#  688|       if (!pixs || pixGetDepth(pixs) != 32)
#  689|->         return (PIX *)ERROR_PTR("pixs undefined or not 32 bpp", __func__, pixd);
#  690|       if (pixd && (pixd != pixs))
#  691|           return (PIX *)ERROR_PTR("pixd exists, but != pixs", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c: scope_hint: In function ‘pixLinearMapToTargetColor.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:689:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:702:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/coloring.c:706:23: note: in expansion of macro ‘ERROR_PTR’
#  687|   
#  688|       if (!pixs || pixGetDepth(pixs) != 32)
#  689|->         return (PIX *)ERROR_PTR("pixs undefined or not 32 bpp", __func__, pixd);
#  690|       if (pixd && (pixd != pixs))
#  691|           return (PIX *)ERROR_PTR("pixd exists, but != pixs", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def132]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:135:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:113: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:134:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:134:23: note: in expansion of macro ‘LEPT_CALLOC’
#  133|   
#  134|       cmap = (PIXCMAP *)LEPT_CALLOC(1, sizeof(PIXCMAP));
#  135|->     cmap->depth = depth;
#  136|       cmap->nalloc = 1 << depth;
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def133]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapAddColor’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:417:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cta’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:134:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:137:24: note: in expansion of macro ‘LEPT_CALLOC’
#  415|   
#  416|       cta = (RGBA_QUAD *)cmap->array;
#  417|->     cta[cmap->n].red = rval;
#  418|       cta[cmap->n].green = gval;
#  419|       cta[cmap->n].blue = bval;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def134]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapAddRGBA’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:454:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cta’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:137:24: note: in expansion of macro ‘LEPT_CALLOC’
#  452|   
#  453|       cta = (RGBA_QUAD *)cmap->array;
#  454|->     cta[cmap->n].red = rval;
#  455|       cta[cmap->n].green = gval;
#  456|       cta[cmap->n].blue = bval;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapGrayToFalseColor’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:1560:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘curve’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:1556:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1558|       for (i = 0; i < 64; i++) {
# 1559|           x = (l_float32)i / 64.;
# 1560|->         curve[i] = (l_int32)(255. * powf(x, invgamma) + 0.5);
# 1561|       }
# 1562|   

Error: COMPILER_WARNING (CWE-563): [#def136]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapReadStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:1791:35: warning[-Wunused-but-set-variable]: variable ‘ignore’ set but not used
# 1791 | l_int32   rval, gval, bval, aval, ignore;
#      |                                   ^~~~~~
# 1789|   pixcmapReadStream(FILE  *fp)
# 1790|   {
# 1791|-> l_int32   rval, gval, bval, aval, ignore;
# 1792|   l_int32   i, index, ret, depth, ncolors;
# 1793|   PIXCMAP  *cmap;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def137]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapToArrays.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2015:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2002:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2013|       cta = (RGBA_QUAD *)cmap->array;
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|->         rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def138]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2016:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2003:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|           rmap[i] = cta[i].red;
# 2016|->         gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;
# 2018|           if (pamap)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def139]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2017:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2004:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2015|           rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|->         bmap[i] = cta[i].blue;
# 2018|           if (pamap)
# 2019|               amap[i] = cta[i].alpha;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2019:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘amap’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2009:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2009:27: note: in expansion of macro ‘LEPT_CALLOC’
# 2017|           bmap[i] = cta[i].blue;
# 2018|           if (pamap)
# 2019|->             amap[i] = cta[i].alpha;
# 2020|       }
# 2021|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapSerializeToMemory’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2102:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2097:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2100|       for (i = 0; i < ncolors; i++) {
# 2101|           pixcmapGetRGBA(cmap, i, &rval, &gval, &bval, &aval);
# 2102|->         data[cpc * i] = rval;
# 2103|           data[cpc * i + 1] = gval;
# 2104|           data[cpc * i + 2] = bval;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def142]
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c: scope_hint: In function ‘pixcmapConvertToHex’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2194:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hexdata’
leptonica-1.85.0-build/leptonica-1.85.0/src/colormap.c:2193:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2192|       hexbytes = 2 + (2 * 3 + 1) * ncolors + 2;
# 2193|       hexdata = (char *)LEPT_CALLOC(hexbytes, sizeof(char));
# 2194|->     hexdata[0] = '<';
# 2195|       hexdata[1] = ' ';
# 2196|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def143]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixOctreeColorQuantGeneral.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:682:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:122: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:746:28: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:985:23: note: in expansion of macro ‘ERROR_PTR’
#  680|   
#  681|           /* Attach colormap and copy res */
#  682|->     pixSetColormap(pixd, cmap);
#  683|       pixCopyResolution(pixd, pixs);
#  684|       pixCopyInputFormat(pixd, pixs);

Error: COMPILER_WARNING (CWE-457): [#def144]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:688:5: warning[-Wmaybe-uninitialized]: ‘cmap’ may be used uninitialized
#  688 |     pixcmapGetColor(cmap, index, &rval, &gval, &bval);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixOctreeColorQuantGeneral’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:612:12: note: ‘cmap’ was declared here
#  612 | PIXCMAP   *cmap;
#      |            ^~~~
#  686|           /* Force darkest color to black if each component <= 4 */
#  687|       pixcmapGetRankIntensity(cmap, 0.0, &index);
#  688|->     pixcmapGetColor(cmap, index, &rval, &gval, &bval);
#  689|       if (rval < 5 && gval < 5 && bval < 5)
#  690|           pixcmapResetColor(cmap, index, 0, 0, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘cqcellTreeCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1264:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cqcaa’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1260:25: note: in expansion of macro ‘LEPT_CALLOC’
# 1262|           ncells = 1 << (3 * level);
# 1263|           cqca = (CQCELL **)LEPT_CALLOC(ncells, sizeof(CQCELL *));
# 1264|->         cqcaa[level] = cqca;
# 1265|           for (i = 0; i < ncells; i++) {
# 1266|               cqca[i] = (CQCELL *)LEPT_CALLOC(1, sizeof(CQCELL));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def146]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1266:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cqca’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1263:27: note: in expansion of macro ‘LEPT_CALLOC’
# 1264|           cqcaa[level] = cqca;
# 1265|           for (i = 0; i < ncells; i++) {
# 1266|->             cqca[i] = (CQCELL *)LEPT_CALLOC(1, sizeof(CQCELL));
# 1267|           }
# 1268|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixOctreeQuantNumColors’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2311:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 32)’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2305:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2310:33: note: in expansion of macro ‘LEPT_CALLOC’
# 2309|           for (i = 0; i < nbase; i++) {
# 2310|               oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2311|->             oqca[i]->n = 0.0;
# 2312|           }
# 2313|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2376:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘oqca’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2374:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2374:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2374|       oqca = (OQCELL **)LEPT_CALLOC(ncubes, sizeof(OQCELL *));
# 2375|       for (i = 0; i < ncubes; i++) {
# 2376|->         oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2377|           oqca[i]->n = 0.0;
# 2378|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2377:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 32)’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2374:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2376:29: note: in expansion of macro ‘LEPT_CALLOC’
# 2375|       for (i = 0; i < ncubes; i++) {
# 2376|           oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2377|->         oqca[i]->n = 0.0;
# 2378|       }
# 2379|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2790:16: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2849:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2851:28: note: in expansion of macro ‘LEPT_CALLOC’
# 2788|   
# 2789|       if (!pixs)
# 2790|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2791|       if (pixGetDepth(pixs) != 32)
# 2792|           return (PIX *)ERROR_PTR("pixs not 32 bpp", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixFixedOctcubeQuant256’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2790:16: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2849:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2850:28: note: in expansion of macro ‘LEPT_CALLOC’
# 2788|   
# 2789|       if (!pixs)
# 2790|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2791|       if (pixGetDepth(pixs) != 32)
# 2792|           return (PIX *)ERROR_PTR("pixs not 32 bpp", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2790:16: warning[-Wanalyzer-malloc-leak]: leak of ‘itab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2849:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2852:27: note: in expansion of macro ‘LEPT_CALLOC’
# 2788|   
# 2789|       if (!pixs)
# 2790|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2791|       if (pixGetDepth(pixs) != 32)
# 2792|           return (PIX *)ERROR_PTR("pixs not 32 bpp", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2790:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2849:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2849:28: note: in expansion of macro ‘LEPT_CALLOC’
# 2788|   
# 2789|       if (!pixs)
# 2790|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2791|       if (pixGetDepth(pixs) != 32)
# 2792|           return (PIX *)ERROR_PTR("pixs not 32 bpp", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def154]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixFewColorsOctcubeQuantMixed’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3306:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:2924:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3304:22: note: in expansion of macro ‘LEPT_CALLOC’
# 3304|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 3305|       for (i = 0; i < 256; i++)
# 3306|->         lut[i] = -1;
# 3307|       for (i = 0, index = 0; i < ncolors; i++) {
# 3308|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def155]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixFixedOctcubeQuantGenRGB’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3418:28: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
# 3416|           for (j = 0; j < w; j++) {
# 3417|               extractRGBValues(lines[j], &rval, &gval, &bval);
# 3418|->             octindex = rtab[rval] | gtab[gval] | btab[bval];
# 3419|               getRGBFromOctcube(octindex, level, &rval, &gval, &bval);
# 3420|               composeRGBPixel(rval, gval, bval, lined + j);

Error: COMPILER_WARNING (CWE-457): [#def156]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3716:15: warning[-Wmaybe-uninitialized]: ‘size’ may be used uninitialized
# 3716 |     if ((na = numaCreate(size)) == NULL) {
#      |               ^~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixOctcubeHistogram’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3693:13: note: ‘size’ was declared here
# 3693 | l_int32     size, i, j, w, h, wpl, ncolors, val;
#      |             ^~~~
# 3714|       makeRGBToIndexTables(level, &rtab, &gtab, &btab);
# 3715|   
# 3716|->     if ((na = numaCreate(size)) == NULL) {
# 3717|           L_ERROR("na not made\n", __func__);
# 3718|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def157]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘pixRemoveUnusedColors’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3963:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map1’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3958:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3958:23: note: in expansion of macro ‘LEPT_CALLOC’
# 3961|       for (i = 0; i < nc; i++) {
# 3962|           if (histo[i] != 0) {
# 3963|->             map1[index] = i;  /* get old index from new */
# 3964|               map2[i] = index;  /* get new index from old */
# 3965|               index++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def158]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3964:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map2’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3958:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3959:23: note: in expansion of macro ‘LEPT_CALLOC’
# 3962|           if (histo[i] != 0) {
# 3963|               map1[index] = i;  /* get old index from new */
# 3964|->             map2[i] = index;  /* get new index from old */
# 3965|               index++;
# 3966|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def159]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c: scope_hint: In function ‘pixMedianCutQuantGeneral’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:384:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  382|       smalln = TRUE;
#  383|       for (i = 0; i < histosize; i++) {
#  384|->         if (histo[i])
#  385|               ncolors++;
#  386|           if (ncolors > maxcolors) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def160]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c: scope_hint: In function ‘pixMedianCutQuantMixed.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:651:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:177: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:649:22: note: in expansion of macro ‘LEPT_CALLOC’
#  649|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  650|       for (i = 0; i < 256; i++)
#  651|->         lut[i] = ncolor + 1 + (i * (ngray - 1) + 128) / 255;
#  652|       for (i = 0; i < h; i++) {
#  653|           linec = datac + i * wplc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def161]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:1632:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘vbox’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c: scope_hint: In function ‘box3dCopy.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant2.c:1631:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1630|   
# 1631|       vbox = (L_BOX3D *)LEPT_CALLOC(1, sizeof(L_BOX3D));
# 1632|->     vbox->r1 = r1;
# 1633|       vbox->r2 = r2;
# 1634|       vbox->g1 = g1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def162]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c: scope_hint: In function ‘pixColorSegmentTryCluster’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c:320:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countarray[k]’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c:46: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c:319:21: note: in expansion of macro ‘SET_DATA_BYTE’
#  318|                       found = TRUE;
#  319|                       SET_DATA_BYTE(lined, j, k);
#  320|->                     countarray[k]++;
#  321|                       rsum[k] += rval;
#  322|                       gsum[k] += gval;

Error: COMPILER_WARNING (CWE-457): [#def163]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c: scope_hint: In function ‘pixAssignToNearestColor’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorseg.c:413:30: warning[-Wmaybe-uninitialized]: ‘wplm’ may be used uninitialized
#  413 | l_int32    w, h, wpls, wpld, wplm, i, j, success;
#      |                              ^~~~
#  411|                           l_int32  *countarray)
#  412|   {
#  413|-> l_int32    w, h, wpls, wpld, wplm, i, j, success;
#  414|   l_int32    rval, gval, bval, index;
#  415|   l_int32   *cmaptab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def164]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorspace.c: scope_hint: In function ‘pixMakeRangeMaskHV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorspace.c:824:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hlut’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorspace.c:91: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/colorspace.c:809:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorspace.c:809:23: note: in expansion of macro ‘LEPT_CALLOC’
#  822|               hlut[i] = 1;
#  823|           for (i = 0; i <= hend; i++)
#  824|->             hlut[i] = 1;
#  825|       }
#  826|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def165]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pixSeedfill4BB’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:675:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
#  673|                * And any segments found anywhere are always extended
#  674|                * in the +dy direction.  */
#  675|->         for (x = x1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  676|               CLEAR_DATA_BIT(line,x);
#  677|           if (x >= x1)  /* pix at x1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def166]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pixSeedfill8BB’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:788:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
#  786|                * And any segments found anywhere are always extended
#  787|                * in the +dy direction.  */
#  788|->         for (x = x1 - 1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  789|               CLEAR_DATA_BIT(line,x);
#  790|           if (x >= x1 - 1)  /* pix at x1 - 1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def167]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pixSeedfill4’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:926:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
#  924|                * And any segments found anywhere are always extended
#  925|                * in the +dy direction.  */
#  926|->         for (x = x1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  927|               CLEAR_DATA_BIT(line,x);
#  928|           if (x >= x1)  /* pix at x1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def168]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pixSeedfill8’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1018:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
# 1016|                * And any segments found anywhere are always extended
# 1017|                * in the +dy direction.  */
# 1018|->         for (x = x1 - 1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
# 1019|               CLEAR_DATA_BIT(line,x);
# 1020|           if (x >= x1 - 1)  /* pix at x1 - 1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def169]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pushFillsegBB’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1107:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fseg’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:95: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:260:26: note: in definition of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1106:31: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1106:31: note: in expansion of macro ‘LEPT_CALLOC’
# 1105|           else
# 1106|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1107|->         fseg->xleft = xleft;
# 1108|           fseg->xright = xright;
# 1109|           fseg->y = y;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c: scope_hint: In function ‘pushFillseg.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1161:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fseg’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1160:31: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/conncomp.c:1160:31: note: in expansion of macro ‘LEPT_CALLOC’
# 1159|           else
# 1160|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1161|->         fseg->xleft = xleft;
# 1162|           fseg->xright = xright;
# 1163|           fseg->y = y;

Error: COMPILER_WARNING (CWE-457): [#def171]
leptonica-1.85.0-build/leptonica-1.85.0/src/convolve.c: scope_hint: In function ‘pixWindowedVariance’
leptonica-1.85.0-build/leptonica-1.85.0/src/convolve.c:1271:50: warning[-Wmaybe-uninitialized]: ‘wplv’ may be used uninitialized
# 1271 | l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
#      |                                                  ^~~~
# 1269|                       FPIX  **pfpixrv)
# 1270|   {
# 1271|-> l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
# 1272|   l_float32   var;
# 1273|   l_uint32   *linem, *linems, *datam, *datams;

Error: COMPILER_WARNING (CWE-457): [#def172]
leptonica-1.85.0-build/leptonica-1.85.0/src/convolve.c:1271:56: warning[-Wmaybe-uninitialized]: ‘wplrv’ may be used uninitialized
# 1271 | l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
#      |                                                        ^~~~~
# 1269|                       FPIX  **pfpixrv)
# 1270|   {
# 1271|-> l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
# 1272|   l_float32   var;
# 1273|   l_uint32   *linem, *linems, *datam, *datams;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def173]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c: scope_hint: In function ‘pixCorrelationScoreThresholded’
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:543:42: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:56: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  541|                        * rows is below the threshold. */
#  542|                   if (count >= threshold) return TRUE;
#  543|->                 if (count + downcount[y] - untouchable < threshold) {
#  544|                       return FALSE;
#  545|                   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def174]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:600:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  598|   
#  599|                       if (count >= threshold) return TRUE;
#  600|->                     if (count + downcount[y] - untouchable < threshold) {
#  601|                           return FALSE;
#  602|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def175]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:631:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  629|   
#  630|                       if (count >= threshold) return TRUE;
#  631|->                     if (count + downcount[y] - untouchable < threshold) {
#  632|                           return FALSE;
#  633|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def176]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:658:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  656|   
#  657|                       if (count >= threshold) return TRUE;
#  658|->                     if (count + downcount[y] - untouchable < threshold) {
#  659|                           return FALSE;
#  660|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def177]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:686:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:270:49: note: in definition of macro ‘L_ABS’
#  684|   
#  685|                       if (count >= threshold) return TRUE;
#  686|->                     if (count + downcount[y] - untouchable < threshold) {
#  687|                           return FALSE;
#  688|                       }

Error: COMPILER_WARNING (CWE-457): [#def178]
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c: scope_hint: In function ‘pixCorrelationScoreThresholded’
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:686:46: warning[-Wmaybe-uninitialized]: ‘untouchable’ may be used uninitialized
#  686 |                     if (count + downcount[y] - untouchable < threshold) {
#      |                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/correlscore.c:437:52: note: ‘untouchable’ was declared here
#  437 | l_int32    wpl1, wpl2, lorow, hirow, locol, hicol, untouchable;
#      |                                                    ^~~~~~~~~~~
#  684|   
#  685|                       if (count >= threshold) return TRUE;
#  686|->                     if (count + downcount[y] - untouchable < threshold) {
#  687|                           return FALSE;
#  688|                       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def179]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c: scope_hint: In function ‘dewarpCreate.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:470:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dew’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:417: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:469:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:469:23: note: in expansion of macro ‘LEPT_CALLOC’
#  468|   
#  469|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  470|->     dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def180]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c: scope_hint: In function ‘dewarpaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:609:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dewa’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:608:25: note: in expansion of macro ‘LEPT_CALLOC’
#  607|   
#  608|       dewa = (L_DEWARPA *)LEPT_CALLOC(1, sizeof(L_DEWARPA));
#  609|->     dewa->dewarp = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  610|       dewa->dewarpcache = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  611|       if (!dewa->dewarp || !dewa->dewarpcache) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def181]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c: scope_hint: In function ‘dewarpReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:1210:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dew’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:1209:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1208|   
# 1209|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
# 1210|->     dew->w = w;
# 1211|       dew->h = h;
# 1212|       dew->pageno = pageno;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def182]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c: scope_hint: In function ‘dewarpaReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp1.c:1494:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1492|   
# 1493|       dewa = dewarpaCreate(maxpage + 1, sampling, redfactor, minlines, maxdist);
# 1494|->     dewa->maxpage = maxpage;
# 1495|       dewa->max_linecurv = max_linecurv;
# 1496|       dewa->min_diff_linecurv = min_diff_linecurv;

Error: CPPCHECK_WARNING (CWE-457): [#def183]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1316: warning[uninitvar]: Uninitialized variable: ytop
# 1314|       *pntop = ntop;
# 1315|       *pnbot = nbot;
# 1316|->     *pytop = ytop;
# 1317|       *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def184]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c: scope_hint: In function ‘dewarpIsLineCoverageValid’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1316:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ytop’
# 1314|       *pntop = ntop;
# 1315|       *pnbot = nbot;
# 1316|->     *pytop = ytop;
# 1317|       *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */

Error: CPPCHECK_WARNING (CWE-457): [#def185]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1317: warning[uninitvar]: Uninitialized variable: ybot
# 1315|       *pnbot = nbot;
# 1316|       *pytop = ytop;
# 1317|->     *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def186]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1317:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ybot’
# 1315|       *pnbot = nbot;
# 1316|       *pytop = ytop;
# 1317|->     *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);

Error: COMPILER_WARNING (CWE-457): [#def187]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1320:33: warning[-Wmaybe-uninitialized]: ‘ybot’ may be used uninitialized
# 1320 |     fraction = (l_float32)(ybot - ytop) / (l_float32)h;
#      |                           ~~~~~~^~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c: scope_hint: In function ‘dewarpBuildPageModel’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:1284:53: note: ‘ybot’ was declared here
# 1284 | l_int32    i, n, iy, both_halves, ntop, nbot, ytop, ybot, nmin;
#      |                                                     ^~~~
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);
# 1320|->     fraction = (l_float32)(ybot - ytop) / (l_float32)h;
# 1321|       if (both_halves && fraction > 0.50)
# 1322|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def188]
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp3.c: scope_hint: In function ‘dewarpaApplyDisparityBoxa’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp3.c:584:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dew’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp3.c:59: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp3.c:649:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp3.c:649:24: note: in expansion of macro ‘ERROR_PTR’
#  582|   
#  583|           /* Optionally, correct for horizontal disparity */
#  584|->     if (dewa->useboth && dew->hsuccess && !dew->skip_horiz) {
#  585|           if (dew->hvalid == FALSE) {
#  586|               L_INFO("invalid horiz model for page %d\n", __func__, pageno);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def189]
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c: scope_hint: In function ‘l_dnaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:187:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘da’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:157: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:186:19: note: in expansion of macro ‘LEPT_CALLOC’
#  185|   
#  186|       da = (L_DNA *)LEPT_CALLOC(1, sizeof(L_DNA));
#  187|->     if ((da->array = (l_float64 *)LEPT_CALLOC(n, sizeof(l_float64))) == NULL) {
#  188|           l_dnaDestroy(&da);
#  189|           return (L_DNA *)ERROR_PTR("double array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c: scope_hint: In function ‘l_dnaDestroy’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:341:10: warning[-Wanalyzer-malloc-leak]: leak of ‘da’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:186:19: note: in expansion of macro ‘LEPT_CALLOC’
#  339|           LEPT_FREE(da);
#  340|       }
#  341|->     *pda = NULL;
#  342|   }
#  343|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def191]
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c: scope_hint: In function ‘l_dnaaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:1194:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘daa’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnabasic.c:1193:21: note: in expansion of macro ‘LEPT_CALLOC’
# 1192|   
# 1193|       daa = (L_DNAA *)LEPT_CALLOC(1, sizeof(L_DNAA));
# 1194|->     if ((daa->dna = (L_DNA **)LEPT_CALLOC(n, sizeof(L_DNA *))) == NULL) {
# 1195|           l_dnaaDestroy(&daa);
# 1196|           return (L_DNAA *)ERROR_PTR("l_dna ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def192]
leptonica-1.85.0-build/leptonica-1.85.0/src/dnahash.c: scope_hint: In function ‘l_dnaHashCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnahash.c:85:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dahash’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dnahash.c:48: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dnahash.c:84:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/dnahash.c:84:27: note: in expansion of macro ‘LEPT_CALLOC’
#   83|   
#   84|       dahash = (L_DNAHASH *)LEPT_CALLOC(1, sizeof(L_DNAHASH));
#   85|->     if ((dahash->dna = (L_DNA **)LEPT_CALLOC(nbuckets, sizeof(L_DNA *)))
#   86|           == NULL) {
#   87|           LEPT_FREE(dahash);

Error: COMPILER_WARNING (CWE-457): [#def193]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c: scope_hint: In function ‘pixUnsharpMaskingGray1D’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1321:32: warning[-Wmaybe-uninitialized]: ‘a[3]’ may be used uninitialized
# 1321 |                           a[4] * GET_DATA_BYTE(lines, j + 2);
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1265:17: note: ‘a[3]’ was declared here
# 1265 | l_float32  val, a[5];
#      |                 ^
# 1319|                             a[2] * GET_DATA_BYTE(lines, j) +
# 1320|                             a[3] * GET_DATA_BYTE(lines, j + 1) +
# 1321|->                           a[4] * GET_DATA_BYTE(lines, j + 2);
# 1322|                       ival = (l_int32)val;
# 1323|                       ival = L_MAX(0, ival);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def194]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c: scope_hint: In function ‘pixColorShiftRGB.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1931:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rlut’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:123: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1925:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1929|           fi = i;
# 1930|           if (rfract >= 0) {
# 1931|->             rlut[i] = (l_int32)(fi + (255.0 - fi) * rfract);
# 1932|           } else {
# 1933|               rlut[i] = (l_int32)(fi * (1.0 + rfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def195]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1933:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rlut’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1925:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1931|               rlut[i] = (l_int32)(fi + (255.0 - fi) * rfract);
# 1932|           } else {
# 1933|->             rlut[i] = (l_int32)(fi * (1.0 + rfract));
# 1934|           }
# 1935|           if (gfract >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def196]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1936:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘glut’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1926:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1934|           }
# 1935|           if (gfract >= 0) {
# 1936|->             glut[i] = (l_int32)(fi + (255.0 - fi) * gfract);
# 1937|           } else {
# 1938|               glut[i] = (l_int32)(fi * (1.0 + gfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def197]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1938:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘glut’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1926:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1936|               glut[i] = (l_int32)(fi + (255.0 - fi) * gfract);
# 1937|           } else {
# 1938|->             glut[i] = (l_int32)(fi * (1.0 + gfract));
# 1939|           }
# 1940|           if (bfract >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def198]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1941:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blut’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1927:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1939|           }
# 1940|           if (bfract >= 0) {
# 1941|->             blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|               blut[i] = (l_int32)(fi * (1.0 + bfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def199]
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1943:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blut’
leptonica-1.85.0-build/leptonica-1.85.0/src/enhance.c:1927:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1941|               blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|->             blut[i] = (l_int32)(fi * (1.0 + bfract));
# 1944|           }
# 1945|       }

Error: GCC_ANALYZER_WARNING: [#def200]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:377:44: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:388:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:329:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:388:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:377:44: note: only use operands of an integer type inside the size argument
leptonica-1.85.0-build/leptonica-1.85.0/src/bilateral.c:388:28: note: in expansion of macro ‘LEPT_CALLOC’
#  375|   #else
#  376|     #define LEPT_MALLOC(blocksize)           malloc(blocksize)
#  377|->   #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|     #define LEPT_FREE(ptr)                   free(ptr)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c: scope_hint: In function ‘pixacompReadStream.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:377:44: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:49: note: in definition of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:609:25: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1411:21: note: in expansion of macro ‘L_MAX’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
#  375|   #else
#  376|     #define LEPT_MALLOC(blocksize)           malloc(blocksize)
#  377|->   #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|     #define LEPT_FREE(ptr)                   free(ptr)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:377:44: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:49: note: in definition of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:609:25: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1411:21: note: in expansion of macro ‘L_MAX’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
#  375|   #else
#  376|     #define LEPT_MALLOC(blocksize)           malloc(blocksize)
#  377|->   #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|     #define LEPT_FREE(ptr)                   free(ptr)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def203]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iaa’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2874:9: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2830:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2830:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2898:27: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:593:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2858:17: note: in expansion of macro ‘L_ERROR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:49: note: in definition of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2874:9: note: in expansion of macro ‘LEPT_FREE’
#  377|     #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|->   #define LEPT_FREE(ptr)                   free(ptr)
#  380|   #endif   /* LEPTONICA_INTERCEPT_ALLOC */
#  381|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def204]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:154: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c: scope_hint: In function ‘pixLinearTRCTiled’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:44: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘iaa’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2874:9: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2830:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2830:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:49: note: in definition of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/adaptmap.c:2874:9: note: in expansion of macro ‘LEPT_FREE’
#  377|     #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|->   #define LEPT_FREE(ptr)                   free(ptr)
#  380|   #endif   /* LEPTONICA_INTERCEPT_ALLOC */
#  381|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def205]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:44: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3424:5: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:3424:5: note: in expansion of macro ‘LEPT_FREE’
#  377|     #define LEPT_CALLOC(numelem, elemsize)   calloc(numelem, elemsize)
#  378|     #define LEPT_REALLOC(ptr, blocksize)     realloc(ptr, blocksize)
#  379|->   #define LEPT_FREE(ptr)                   free(ptr)
#  380|   #endif   /* LEPTONICA_INTERCEPT_ALLOC */
#  381|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c: scope_hint: In function ‘makeRGBToIndexTables.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1357:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c: scope_hint: In function ‘pixWriteMemBmp’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘cta’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:478:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:549:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:478:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1356:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:57: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c: scope_hint: In function ‘countAlignedMatches’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:962:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:963:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/classapp.c:965:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:64: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1355:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/colorquant1.c:1359:16: note: in expansion of macro ‘ERROR_INT’
#  571|     #define PROCNAME(name)              static const char procName[] = name
#  572|     #define IF_SEV(l, t, f) \
#  573|->       ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
#  574|   
#  575|     #define ERROR_INT(a, b, c) \

Error: COMPILER_WARNING (CWE-457): [#def212]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:598:14: warning[-Wmaybe-uninitialized]: ‘nbot’ may be used uninitialized
#  598 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:159:27: note: ‘nbot’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                           ^~~~
#  596|     #define L_WARNING(a, ...) \
#  597|         IF_SEV(L_SEVERITY_WARNING, \
#  598|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  599|                (void)0)
#  600|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def213]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:67: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:598:14: warning[-Wmaybe-uninitialized]: ‘ntop’ may be used uninitialized
#  598 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:159:21: note: ‘ntop’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                     ^~~~
#  596|     #define L_WARNING(a, ...) \
#  597|         IF_SEV(L_SEVERITY_WARNING, \
#  598|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  599|                (void)0)
#  600|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def214]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:598:14: warning[-Wmaybe-uninitialized]: ‘ybot’ may be used uninitialized
#  598 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:159:39: note: ‘ybot’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                                       ^~~~
#  596|     #define L_WARNING(a, ...) \
#  597|         IF_SEV(L_SEVERITY_WARNING, \
#  598|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  599|                (void)0)
#  600|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def215]
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:598:14: warning[-Wmaybe-uninitialized]: ‘ytop’ may be used uninitialized
#  598 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.85.0-build/leptonica-1.85.0/src/dewarp2.c:159:33: note: ‘ytop’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                                 ^~~~
#  596|     #define L_WARNING(a, ...) \
#  597|         IF_SEV(L_SEVERITY_WARNING, \
#  598|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  599|                (void)0)
#  600|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-563): [#def216]
leptonica-1.85.0-build/leptonica-1.85.0/src/fhmtgenlow.1.c:272:28: warning[-Wunused-but-set-variable]: variable ‘wpls3’ set but not used
#  272 | l_int32             wpls2, wpls3, wpls4;
#      |                            ^~~~~
#  270|   l_int32    j, pwpls;
#  271|   l_uint32  *sptr, *dptr;
#  272|-> l_int32             wpls2, wpls3, wpls4;
#  273|   l_int32             wpls5, wpls6;
#  274|   

Error: COMPILER_WARNING (CWE-563): [#def217]
leptonica-1.85.0-build/leptonica-1.85.0/src/fhmtgenlow.1.c:272:35: warning[-Wunused-but-set-variable]: variable ‘wpls4’ set but not used
#  272 | l_int32             wpls2, wpls3, wpls4;
#      |                                   ^~~~~
#  270|   l_int32    j, pwpls;
#  271|   l_uint32  *sptr, *dptr;
#  272|-> l_int32             wpls2, wpls3, wpls4;
#  273|   l_int32             wpls5, wpls6;
#  274|   

Error: COMPILER_WARNING (CWE-563): [#def218]
leptonica-1.85.0-build/leptonica-1.85.0/src/fhmtgenlow.1.c: scope_hint: In function ‘fhmt_1_5’
leptonica-1.85.0-build/leptonica-1.85.0/src/fhmtgenlow.1.c:273:21: warning[-Wunused-but-set-variable]: variable ‘wpls5’ set but not used
#  273 | l_int32             wpls5, wpls6;
#      |                     ^~~~~
#  271|   l_uint32  *sptr, *dptr;
#  272|   l_int32             wpls2, wpls3, wpls4;
#  273|-> l_int32             wpls5, wpls6;
#  274|   
#  275|       wpls2 = 2 * wpls;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c: scope_hint: In function ‘fpixCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:160:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:124: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:171:21: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:176:25: note: in expansion of macro ‘LEPT_CALLOC’
#  158|   
#  159|       if (width <= 0)
#  160|->         return (FPIX *)ERROR_PTR("width must be > 0", __func__, NULL);
#  161|       if (height <= 0)
#  162|           return (FPIX *)ERROR_PTR("height must be > 0", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def220]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c: scope_hint: In function ‘fpixCopy.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:262:5: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:206:24: note: in expansion of macro ‘ERROR_PTR’
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
#  260|       datas = fpixGetData(fpixs);
#  261|       datad = fpixGetData(fpixd);
#  262|->     memcpy(datad, datas, bytes);
#  263|       return fpixd;
#  264|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def221]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c: scope_hint: In function ‘dpixCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:967:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:978:20: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix1.c:983:25: note: in expansion of macro ‘LEPT_CALLOC’
#  965|   
#  966|       if (width <= 0)
#  967|->         return (DPIX *)ERROR_PTR("width must be > 0", __func__, NULL);
#  968|       if (height <= 0)
#  969|           return (DPIX *)ERROR_PTR("height must be > 0", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def222]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c: scope_hint: In function ‘fpixScaleByInteger’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:920:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fract’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:109: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:918:26: note: in expansion of macro ‘LEPT_CALLOC’
#  918|       fract = (l_float32 *)LEPT_CALLOC(factor, sizeof(l_float32));
#  919|       for (i = 0; i < factor; i++)
#  920|->         fract[i] = i / (l_float32)factor;
#  921|       for (i = 0; i < hs - 1; i++) {
#  922|           lines = datas + i * wpls;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def223]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c: scope_hint: In function ‘dpixScaleByInteger’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1010:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fract’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1008:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1008|       fract = (l_float64 *)LEPT_CALLOC(factor, sizeof(l_float64));
# 1009|       for (i = 0; i < factor; i++)
# 1010|->         fract[i] = i / (l_float64)factor;
# 1011|       for (i = 0; i < hs - 1; i++) {
# 1012|           lines = datas + i * wpls;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def224]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c: scope_hint: In function ‘fpixFlipLR’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1864:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1861:27: note: in expansion of macro ‘LEPT_CALLOC’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1862|       for (i = 0; i < h; i++) {
# 1863|           line = data + i * wpl;
# 1864|->         memcpy(buffer, line, bpl);
# 1865|           for (j = 0; j < w; j++)
# 1866|               line[j] = buffer[w - 1 - j];

Error: GCC_ANALYZER_WARNING (CWE-688): [#def225]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c: scope_hint: In function ‘fpixFlipTB’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1916:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:1910:27: note: in expansion of macro ‘LEPT_CALLOC’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1914|           linet = data + i * wpl;
# 1915|           lineb = data + k * wpl;
# 1916|->         memcpy(buffer, linet, bpl);
# 1917|           memcpy(linet, lineb, bpl);
# 1918|           memcpy(lineb, buffer, bpl);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def226]
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c: scope_hint: In function ‘pixComponentFunction’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:2325:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘recip’
leptonica-1.85.0-build/leptonica-1.85.0/src/fpix2.c:2324:30: note: in expansion of macro ‘LEPT_CALLOC’
# 2323|       if (onedenom) {
# 2324|           recip = (l_float32 *)LEPT_CALLOC(256, sizeof(l_float32));
# 2325|->         recip[0] = 256;  /* arbitrary large number */
# 2326|           for (i = 1; i < 256; i++)
# 2327|               recip[i] = 1.0 / (l_float32)i;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def227]
leptonica-1.85.0-build/leptonica-1.85.0/src/gifio.c: scope_hint: In function ‘pixWriteStreamGif’
leptonica-1.85.0-build/leptonica-1.85.0/src/gifio.c:389:14: warning[-Wanalyzer-null-argument]: use of NULL ‘filedata’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/gifio.c:80: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/gifio.c:390:5: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:31: included_from: Included from here.
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  387|   
#  388|       rewind(fp);
#  389|->     nbytes = fwrite(filedata, 1, filebytes, fp);
#  390|       LEPT_FREE(filedata);
#  391|       if (nbytes != filebytes)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def228]
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c: scope_hint: In function ‘gplotCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:221:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gplot’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:153: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:220:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:220:22: note: in expansion of macro ‘LEPT_CALLOC’
#  219|   
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|->     gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);

Error: COMPILER_WARNING (CWE-563): [#def229]
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:1209:47: warning[-Wunused-but-set-variable]: variable ‘ignores’ set but not used
# 1209 | char    *rootname, *title, *xlabel, *ylabel, *ignores;
#      |                                               ^~~~~~~
# 1207|   {
# 1208|   char     buf[Bufsize];
# 1209|-> char    *rootname, *title, *xlabel, *ylabel, *ignores;
# 1210|   l_int32  outformat, ret, version, ignore;
# 1211|   FILE    *fp;

Error: COMPILER_WARNING (CWE-563): [#def230]
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c: scope_hint: In function ‘gplotRead’
leptonica-1.85.0-build/leptonica-1.85.0/src/gplot.c:1210:35: warning[-Wunused-but-set-variable]: variable ‘ignore’ set but not used
# 1210 | l_int32  outformat, ret, version, ignore;
#      |                                   ^~~~~~
# 1208|   char     buf[Bufsize];
# 1209|   char    *rootname, *title, *xlabel, *ylabel, *ignores;
# 1210|-> l_int32  outformat, ret, version, ignore;
# 1211|   FILE    *fp;
# 1212|   GPLOT   *gplot;

Error: COMPILER_WARNING (CWE-457): [#def231]
leptonica-1.85.0-build/leptonica-1.85.0/src/graphics.c: scope_hint: In function ‘pixRenderPtaArb’
leptonica-1.85.0-build/leptonica-1.85.0/src/graphics.c:1371:13: warning[-Wmaybe-uninitialized]: ‘val’ may be used uninitialized
# 1371 |             pixSetPixel(pix, x, y, val);
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/graphics.c:1327:11: note: ‘val’ was declared here
# 1327 | l_uint8   val;
#      |           ^~~
# 1369|               pixSetPixel(pix, x, y, val32);
# 1370|           else
# 1371|->             pixSetPixel(pix, x, y, val);
# 1372|       }
# 1373|   

Error: CPPCHECK_WARNING (CWE-758): [#def232]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:556: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  554|                   dword |= ((gval - thresh) >> 30) & 2;
#  555|                   gval = sword & 0xf;
#  556|->                 dword |= ((gval - thresh) >> 31) & 1;
#  557|               }
#  558|               lined[dcount++] = dword;

Error: COMPILER_WARNING (CWE-457): [#def233]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘thresholdToBinaryLineLow’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:568:21: warning[-Wmaybe-uninitialized]: ‘sword’ may be used uninitialized
#  568 |               sword <<= 4;
#      |               ~~~~~~^~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:524:10: note: ‘sword’ was declared here
#  524 | l_uint32 sword, dword;
#      |          ^~~~~
#  566|                 }
#  567|                 gval = (sword >> 28) & 0xf;
#  568|->               sword <<= 4;
#  569|                 dword |= (((gval - thresh) >> 31) & 1) << (31 - (j & 31));
#  570|             }

Error: CPPCHECK_WARNING (CWE-758): [#def234]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:569: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  567|                 gval = (sword >> 28) & 0xf;
#  568|                 sword <<= 4;
#  569|->               dword |= (((gval - thresh) >> 31) & 1) << (31 - (j & 31));
#  570|             }
#  571|             lined[dcount] = dword;

Error: CPPCHECK_WARNING (CWE-758): [#def235]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:597: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  595|                   dword |= ((gval - thresh) >> 30) & 2;
#  596|                   gval = sword & 0xff;
#  597|->                 dword |= ((gval - thresh) >> 31) & 1;
#  598|               }
#  599|               lined[dcount++] = dword;

Error: CPPCHECK_WARNING (CWE-758): [#def236]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:610: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  608|                   gval = (sword >> 24) & 0xff;
#  609|                   sword <<= 8;
#  610|->                 dword |= (l_uint64)(((gval - thresh) >> 31) & 1)
#  611|                                << (31 - (j & 31));
#  612|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def237]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘make8To2DitherTables’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1272:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tabval’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:106: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1263:25: note: in expansion of macro ‘LEPT_CALLOC’
# 1270|       for (i = 0; i < 256; i++) {
# 1271|           if (i <= cliptoblack) {
# 1272|->             tabval[i] = 0;
# 1273|               tab38[i] = 0;
# 1274|               tab14[i] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def238]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1273:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab38’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1264:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1271|           if (i <= cliptoblack) {
# 1272|               tabval[i] = 0;
# 1273|->             tab38[i] = 0;
# 1274|               tab14[i] = 0;
# 1275|           } else if (i < 43) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1274:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab14’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1265:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1272|               tabval[i] = 0;
# 1273|               tab38[i] = 0;
# 1274|->             tab14[i] = 0;
# 1275|           } else if (i < 43) {
# 1276|               tabval[i] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1276:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tabval’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1263:25: note: in expansion of macro ‘LEPT_CALLOC’
# 1274|               tab14[i] = 0;
# 1275|           } else if (i < 43) {
# 1276|->             tabval[i] = 0;
# 1277|               tab38[i] = (3 * i + 4) / 8;
# 1278|               tab14[i] = (i + 2) / 4;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1277:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab38’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1264:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1275|           } else if (i < 43) {
# 1276|               tabval[i] = 0;
# 1277|->             tab38[i] = (3 * i + 4) / 8;
# 1278|               tab14[i] = (i + 2) / 4;
# 1279|           } else if (i < 85) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def242]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1278:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab14’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1265:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1276|               tabval[i] = 0;
# 1277|               tab38[i] = (3 * i + 4) / 8;
# 1278|->             tab14[i] = (i + 2) / 4;
# 1279|           } else if (i < 85) {
# 1280|               tabval[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘makeGrayQuantIndexTable’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1830:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1825:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1828|               thresh = 255 * (2 * j + 1) / (2 * nlevels - 2);
# 1829|               if (i <= thresh) {
# 1830|->                 tab[i] = j;
# 1831|   /*                lept_stderr("tab[%d] = %d\n", i, j); */
# 1832|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘makeGrayQuantTargetTable’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1884:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1875:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1882|               if (i <= thresh) {
# 1883|                   quantval = maxval * j / (nlevels - 1);
# 1884|->                 tab[i] = quantval;
# 1885|   /*                lept_stderr("tab[%d] = %d\n", i, tab[i]); */
# 1886|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘makeGrayQuantTableArb’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1956:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1945:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:1945:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1954|           pixcmapAddColor(cmap, ave, ave, ave);
# 1955|           for (j = jstart; j < val; j++)
# 1956|->             tab[j] = i;
# 1957|           jstart = val;
# 1958|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def246]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘makeGrayQuantColormapArb’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2051:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘binstart’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2016:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2018:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2036:27: note: in expansion of macro ‘LEPT_CALLOC’
# 2049|           } else {  /* no samples in the bin */
# 2050|               if (i < nbins - 1)
# 2051|->                 val = (binstart[i] + binstart[i + 1]) / 2;
# 2052|               else  /* last bin */
# 2053|                   val = (binstart[i] + 255) / 2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def247]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2053:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘binstart’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2016:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2018:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2036:27: note: in expansion of macro ‘LEPT_CALLOC’
# 2051|                   val = (binstart[i] + binstart[i + 1]) / 2;
# 2052|               else  /* last bin */
# 2053|->                 val = (binstart[i] + 255) / 2;
# 2054|           }
# 2055|           pixcmapAddColor(*pcmap, val, val, val);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def248]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘numaFillCmapFromHisto’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2472:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2454:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2470|       ret = 0;
# 2471|       for (i = 0; i < 256; i++) {
# 2472|->         lut[i] = index;
# 2473|           sum += iahisto[i];
# 2474|           wtsum += i * iahisto[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def249]
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c: scope_hint: In function ‘pixGrayQuantFromCmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2560:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/grayquant.c:2557:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2558|       for (i = 0; i < 256; i++) {
# 2559|           pixcmapGetNearestGrayIndex(cmapd, i, &index);
# 2560|->         tab[i] = index;
# 2561|       }
# 2562|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def250]
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c: scope_hint: In function ‘l_hmapCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:124:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:67: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:122:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:122:25: note: in expansion of macro ‘LEPT_CALLOC’
#  122|       hmap = (L_HASHMAP *)LEPT_CALLOC(1, sizeof(L_HASHMAP));
#  123|       findNextLargerPrime(size, &tabsize);  /* at least 101 */
#  124|->     if ((hmap->hashtab =
#  125|           (L_HASHITEM **)LEPT_CALLOC(tabsize, sizeof(L_HASHITEM *))) == NULL) {
#  126|           LEPT_FREE(hmap);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c: scope_hint: In function ‘l_hmapLookup’
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:226:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hitem’
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:225:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/hashmap.c:225:27: note: in expansion of macro ‘LEPT_CALLOC’
#  224|            * Make a new hitem and add to the head of the list */
#  225|       hitem = (L_HASHITEM *)LEPT_CALLOC(1, sizeof(L_HASHITEM));
#  226|->     hitem->key = key;
#  227|       hitem->val = val;
#  228|       hitem->count = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def252]
leptonica-1.85.0-build/leptonica-1.85.0/src/heap.c: scope_hint: In function ‘lheapCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/heap.c:122:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lh’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/heap.c:85: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/heap.c:121:20: note: in expansion of macro ‘LEPT_CALLOC’
#  120|           /* Allocate ptr array and initialize counters. */
#  121|       lh = (L_HEAP *)LEPT_CALLOC(1, sizeof(L_HEAP));
#  122|->     if ((lh->array = (void **)LEPT_CALLOC(n, sizeof(void *))) == NULL) {
#  123|           lheapDestroy(&lh, FALSE);
#  124|           return (L_HEAP *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def253]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbClassifyCorrelation’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1094:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixrowcts’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:211: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1081:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1122:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixcts’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1080:25: note: in expansion of macro ‘LEPT_CALLOC’
# 1120|               ysum += rowcount * y;
# 1121|           }
# 1122|->         pixcts[i] = downcount;
# 1123|           if (downcount > 0) {
# 1124|               ptaAddPt(pta,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def255]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbClasserCreate.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1776:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘classer’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1775:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1775:28: note: in expansion of macro ‘LEPT_CALLOC’
# 1774|   
# 1775|       classer = (JBCLASSER *)LEPT_CALLOC(1, sizeof(JBCLASSER));
# 1776|->     classer->method = method;
# 1777|       classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbDataSave’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1866:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1865:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:1865:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1864|   
# 1865|       data = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 1866|->     data->pix = pix;
# 1867|       data->npages = classer->npages;
# 1868|       data->w = classer->w;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def257]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbDataRead’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2052:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘jbdata’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2051:24: note: in expansion of macro ‘LEPT_CALLOC’
# 2050|   
# 2051|       jbdata = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 2052|->     jbdata->pix = pixs;
# 2053|       jbdata->npages = npages;
# 2054|       jbdata->w = w;

Error: COMPILER_WARNING (CWE-457): [#def258]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbGetULCorners’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2272:35: warning[-Wmaybe-uninitialized]: ‘dx’ may be used uninitialized
# 2272 |         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
#      |                         ~~~~~~~~~~^~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2223:64: note: ‘dx’ was declared here
# 2223 | l_int32    i, baseindex, index, n, iclass, idelx, idely, x, y, dx, dy;
#      |                                                                ^~
# 2270|   /*        if (i % 20 == 0)
# 2271|               lept_stderr("dx = %d, dy = %d\n", dx, dy); */
# 2272|->         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
# 2273|           boxDestroy(&box);
# 2274|           pixDestroy(&pixt);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def259]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘jbGetULCorners’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2272:51: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dy’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2525:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2525:16: note: in expansion of macro ‘ERROR_INT’
# 2270|   /*        if (i % 20 == 0)
# 2271|               lept_stderr("dx = %d, dy = %d\n", dx, dy); */
# 2272|->         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
# 2273|           boxDestroy(&box);
# 2274|           pixDestroy(&pixt);

Error: COMPILER_WARNING (CWE-457): [#def260]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2272:51: warning[-Wmaybe-uninitialized]: ‘dy’ may be used uninitialized
# 2272 |         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
#      |                                         ~~~~~~~~~~^~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2223:68: note: ‘dy’ was declared here
# 2223 | l_int32    i, baseindex, index, n, iclass, idelx, idely, x, y, dx, dy;
#      |                                                                    ^~
# 2270|   /*        if (i % 20 == 0)
# 2271|               lept_stderr("dx = %d, dy = %d\n", dx, dy); */
# 2272|->         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
# 2273|           boxDestroy(&box);
# 2274|           pixDestroy(&pixt);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def261]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘findSimilarSizedTemplatesInit’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2396:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘state’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2395:26: note: in expansion of macro ‘LEPT_CALLOC’
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: CPPCHECK_WARNING (CWE-457): [#def262]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2558: warning[uninitvar]: Uninitialized variable: minx
# 2556|       pixDestroy(&pixr);
# 2557|   
# 2558|->     *pdx = minx;
# 2559|       *pdy = miny;
# 2560|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def263]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c: scope_hint: In function ‘finalPositioningForAlignment’
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2558:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minx’
# 2556|       pixDestroy(&pixr);
# 2557|   
# 2558|->     *pdx = minx;
# 2559|       *pdy = miny;
# 2560|       return 0;

Error: CPPCHECK_WARNING (CWE-457): [#def264]
leptonica-1.85.0-build/leptonica-1.85.0/src/jbclass.c:2559: warning[uninitvar]: Uninitialized variable: miny
# 2557|   
# 2558|       *pdx = minx;
# 2559|->     *pdy = miny;
# 2560|       return 0;
# 2561|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def265]
leptonica-1.85.0-build/leptonica-1.85.0/src/jpegio.c: scope_hint: In function ‘pixReadStreamJpeg’
leptonica-1.85.0-build/leptonica-1.85.0/src/jpegio.c:487:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nwarn’
leptonica-1.85.0-build/leptonica-1.85.0/src/jpegio.c:136: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/jpegio.c:144: included_from: Included from here.
#  485|       rowbuffer = NULL;
#  486|       if (pnwarn) *pnwarn = nwarn;
#  487|->     if (nwarn > 0)
#  488|           L_WARNING("%d warning(s) of bad data\n", __func__, nwarn);
#  489|       return pix;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def266]
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c: scope_hint: In function ‘kernelCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:131:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘kel’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:89: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:130:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:130:23: note: in expansion of macro ‘LEPT_CALLOC’
#  129|   
#  130|       kel = (L_KERNEL *)LEPT_CALLOC(1, sizeof(L_KERNEL));
#  131|->     kel->sy = height;
#  132|       kel->sx = width;
#  133|       if ((kel->data = create2dFloatArray(height, width)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def267]
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c: scope_hint: In function ‘kernelCopy.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:190:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)j * 4’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:130:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:492:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:33: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:33: note: in expansion of macro ‘LEPT_CALLOC’
#  188|       for (i = 0; i < sy; i++)
#  189|           for (j = 0; j < sx; j++)
#  190|->             keld->data[i][j] = kels->data[i][j];
#  191|   
#  192|       return keld;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c: scope_hint: In function ‘kernelSetElement’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:251:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)col * 4’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:130:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:492:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:33: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:33: note: in expansion of macro ‘LEPT_CALLOC’
#  249|           return ERROR_INT("kernel col out of bounds", __func__, 1);
#  250|   
#  251|->     kel->data[row][col] = val;
#  252|       return 0;
#  253|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def269]
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c: scope_hint: In function ‘create2dFloatArray.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:492:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:492:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:494:33: note: in expansion of macro ‘LEPT_CALLOC’
#  492|       array = (l_float32 **)LEPT_CALLOC(sy, sizeof(l_float32 *));
#  493|       for (i = 0; i < sy; i++)
#  494|->         array[i] = (l_float32 *)LEPT_CALLOC(sx, sizeof(l_float32));
#  495|       return array;
#  496|   }

Error: COMPILER_WARNING (CWE-563): [#def270]
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c: scope_hint: In function ‘kernelReadStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/kernel.c:540:48: warning[-Wunused-but-set-variable]: variable ‘ignore’ set but not used
#  540 | l_int32    sy, sx, cy, cx, i, j, ret, version, ignore;
#      |                                                ^~~~~~
#  538|   kernelReadStream(FILE  *fp)
#  539|   {
#  540|-> l_int32    sy, sx, cy, cx, i, j, ret, version, ignore;
#  541|   L_KERNEL  *kel;
#  542|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def271]
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c: scope_hint: In function ‘listAddToHead’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:289:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:218: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:288:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:288:22: note: in expansion of macro ‘LEPT_CALLOC’
#  287|   
#  288|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  289|->     cell->data = data;
#  290|       if (!head) {  /* start the list; initialize the ptrs */
#  291|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def272]
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c: scope_hint: In function ‘listAddToTail’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:342:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:341:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:341:22: note: in expansion of macro ‘LEPT_CALLOC’
#  340|   
#  341|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  342|->     cell->data = data;
#  343|       if (!head) {  /*   Start the list and initialize the ptrs.  *ptail
#  344|                      *   should also have been initialized to NULL */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c: scope_hint: In function ‘listInsertBefore’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:402:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:401:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:401:22: note: in expansion of macro ‘LEPT_CALLOC’
#  400|           /* New cell to insert */
#  401|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  402|->     cell->data = data;
#  403|       if (!head) {  /* start the list; initialize the ptrs */
#  404|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def274]
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c: scope_hint: In function ‘listInsertAfter’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:463:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:462:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/list.c:462:22: note: in expansion of macro ‘LEPT_CALLOC’
#  461|           /* New cell to insert */
#  462|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  463|->     cell->data = data;
#  464|       if (!head) {  /* start the list; initialize the ptrs */
#  465|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def275]
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c: scope_hint: In function ‘l_amapCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:120:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘m’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:105: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:119:19: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:119:19: note: in expansion of macro ‘LEPT_CALLOC’
#  118|   
#  119|       m = (L_AMAP *)LEPT_CALLOC(1, sizeof(L_AMAP));
#  120|->     m->keytype = keytype;
#  121|       return m;
#  122|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def276]
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c: scope_hint: In function ‘l_asetCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:196:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:195:19: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/map.c:195:19: note: in expansion of macro ‘LEPT_CALLOC’
#  194|   
#  195|       s = (L_ASET *)LEPT_CALLOC(1, sizeof(L_ASET));
#  196|->     s->keytype = keytype;
#  197|       return s;
#  198|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def277]
leptonica-1.85.0-build/leptonica-1.85.0/src/maze.c:286:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘el’
leptonica-1.85.0-build/leptonica-1.85.0/src/maze.c: scope_hint: In function ‘generateBinaryMaze’
leptonica-1.85.0-build/leptonica-1.85.0/src/maze.c:285:20: note: in expansion of macro ‘LEPT_CALLOC’
#  284|   
#  285|       el = (MAZEEL *)LEPT_CALLOC(1, sizeof(MAZEEL));
#  286|->     el->x = x;
#  287|       el->y = y;
#  288|       el->dir = dir;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c: scope_hint: In function ‘pixDilate’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:228:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sel’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:170: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1813:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1813:23: note: in expansion of macro ‘ERROR_PTR’
#  226|       for (i = 0; i < sy; i++) {
#  227|           for (j = 0; j < sx; j++) {
#  228|->             seldata = sel->data[i][j];
#  229|               if (seldata == 1) {   /* src | dst */
#  230|                   pixRasterop(pixd, j - cx, i - cy, w, h, PIX_SRC | PIX_DST,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def279]
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c: scope_hint: In function ‘pixErode’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:281:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sel’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1813:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:221:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1811:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:221:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1811:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1811:23: note: in expansion of macro ‘ERROR_PTR’
#  279|       for (i = 0; i < sy; i++) {
#  280|           for (j = 0; j < sx; j++) {
#  281|->             seldata = sel->data[i][j];
#  282|               if (seldata == 1) {   /* src & dst */
#  283|                       pixRasterop(pixd, cx - j, cy - i, w, h, PIX_SRC & PIX_DST,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def280]
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c: scope_hint: In function ‘selectComposableSizes.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/morph.c:1166:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘hival[index]’
# 1164|           }
# 1165|       }
# 1166|->     *pfactor1 = hival[index];
# 1167|       *pfactor2 = lowval[index];
# 1168|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def281]
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c: scope_hint: In function ‘numaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:201:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘na’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:171: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:200:18: note: in expansion of macro ‘LEPT_CALLOC’
#  199|   
#  200|       na = (NUMA *)LEPT_CALLOC(1, sizeof(NUMA));
#  201|->     if ((na->array = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32))) == NULL) {
#  202|           numaDestroy(&na);
#  203|           return (NUMA *)ERROR_PTR("number array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c: scope_hint: In function ‘numaDestroy’
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:376:10: warning[-Wanalyzer-malloc-leak]: leak of ‘na’
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:200:18: note: in expansion of macro ‘LEPT_CALLOC’
#  374|       }
#  375|   
#  376|->     *pna = NULL;
#  377|   }
#  378|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def283]
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c: scope_hint: In function ‘numaaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:1314:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘naa’
leptonica-1.85.0-build/leptonica-1.85.0/src/numabasic.c:1313:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1312|   
# 1313|       naa = (NUMAA *)LEPT_CALLOC(1, sizeof(NUMAA));
# 1314|->     if ((naa->numa = (NUMA **)LEPT_CALLOC(n, sizeof(NUMA *))) == NULL) {
# 1315|           numaaDestroy(&naa);
# 1316|           return (NUMAA *)ERROR_PTR("numa ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-457): [#def284]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc1.c:1476: warning[uninitvar]: Uninitialized variable: istart
# 1474|               break;
# 1475|       }
# 1476|->     if (istart == n)  /* no intervals found */
# 1477|           return nad;
# 1478|   

Error: COMPILER_WARNING (CWE-457): [#def285]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc1.c: scope_hint: In function ‘numaThresholdEdges’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc1.c:1476:8: warning[-Wmaybe-uninitialized]: ‘istart’ may be used uninitialized
# 1476 |     if (istart == n)  /* no intervals found */
#      |        ^
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc1.c:1437:18: note: ‘istart’ was declared here
# 1437 | l_int32    n, i, istart, inband, output, sign;
#      |                  ^~~~~~
# 1474|               break;
# 1475|       }
# 1476|->     if (istart == n)  /* no intervals found */
# 1477|           return nad;
# 1478|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def286]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c: scope_hint: In function ‘grayInterHistogramStats’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2328:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘arrays’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:142: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2323:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2323:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:583:24: note: in expansion of macro ‘ERROR_PTR’
# 2326|           na2 = numaWindowedMean(na1, wc);
# 2327|           na3 = numaNormalizeHistogram(na2, 10000.);
# 2328|->         arrays[i] = numaGetFArray(na3, L_COPY);
# 2329|           numaDestroy(&na1);
# 2330|           numaDestroy(&na2);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def287]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c: scope_hint: In function ‘numaFindExtrema’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2549:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘maxval’
# 2547|               minval = val;
# 2548|               loc = i;
# 2549|->         } else if (direction == 1 && (maxval - val >= delta)) {
# 2550|               numaAddNumber(nad, loc);  /* save the current max location */
# 2551|               if (nav) numaAddNumber(nav, maxval);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def288]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2555:44: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minval’
# 2553|               minval = val;
# 2554|               loc = i;  /* current min location */
# 2555|->         } else if (direction == -1 && (val - minval >= delta)) {
# 2556|               numaAddNumber(nad, loc);  /* save the current min location */
# 2557|               if (nav) numaAddNumber(nav, minval);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def289]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c: scope_hint: In function ‘numaSelectCrossingThreshold’
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2862:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘istart’
# 2860|           if (inrun && (val != maxval)) {
# 2861|               iend = i - 1;
# 2862|->             runlen = iend - istart + 1;
# 2863|               inrun = FALSE;
# 2864|               if (runlen > maxrunlen) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def290]
leptonica-1.85.0-build/leptonica-1.85.0/src/numafunc2.c:2872:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘istart’
# 2870|       }
# 2871|       if (inrun) {
# 2872|->         runlen = i - istart;
# 2873|           if (runlen > maxrunlen) {
# 2874|               maxstart = istart;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def291]
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c: scope_hint: In function ‘pixFindLargestRectangle’
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2604:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lowestfg’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:91: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2602:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2602:27: note: in expansion of macro ‘LEPT_CALLOC’
# 2602|       lowestfg = (l_int32 *)LEPT_CALLOC(w, sizeof(l_int32));
# 2603|       for (i = 0; i < w; i++)
# 2604|->         lowestfg[i] = -1;
# 2605|   
# 2606|           /* The combination (val ^ polarity) is the color for which we

Error: GCC_ANALYZER_WARNING (CWE-476): [#def292]
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2655:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lowestfg’
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2602:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2602:27: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pageseg.c:2620:19: note: in expansion of macro ‘GET_DATA_BIT’
# 2653|               } else {  /* fg (1) if polarity == 0; bg (0) if polarity == 1 */
# 2654|                   prevfg = j;
# 2655|->                 lowestfg[j] = i;
# 2656|                   wp = hp = 0;
# 2657|               }

Error: COMPILER_WARNING (CWE-457): [#def293]
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:528:23: warning[-Wmaybe-uninitialized]: ‘start’ may be used uninitialized
#  528 |     for (i = start; i < stop; i++) {
#      |                     ~~^~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:154:10: note: ‘start’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |          ^~~~~
#  526|   
#  527|       sap = sarrayCreate(0);
#  528|->     for (i = start; i < stop; i++) {
#  529|           str = sarrayGetString(sa, i, L_COPY);
#  530|           sarrayAddString(sap, str, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def294]
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:528:23: warning[-Wmaybe-uninitialized]: ‘stop’ may be used uninitialized
#  528 |     for (i = start; i < stop; i++) {
#      |                     ~~^~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:154:23: note: ‘stop’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |                       ^~~~
#  526|   
#  527|       sap = sarrayCreate(0);
#  528|->     for (i = start; i < stop; i++) {
#  529|           str = sarrayGetString(sa, i, L_COPY);
#  530|           sarrayAddString(sap, str, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def295]
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:533:8: warning[-Wmaybe-uninitialized]: ‘charindex’ may be used uninitialized
#  533 |     str[charindex + 1] = '\0';
#      |        ^
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.85.0-build/leptonica-1.85.0/src/parseprotos.c:154:29: note: ‘charindex’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |                             ^~~~~~~~~
#  531|       }
#  532|       str = sarrayGetString(sa, stop, L_COPY);
#  533|->     str[charindex + 1] = '\0';
#  534|       newstr = stringJoin(str, ";");
#  535|       sarrayAddString(sap, newstr, L_INSERT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def296]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c: scope_hint: In function ‘partifyPixac.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:147:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixaca’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:45: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:145:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:145:24: note: in expansion of macro ‘LEPT_CALLOC’
#  145|       pixaca = (PIXAC **)LEPT_CALLOC(nparts, sizeof(PIXAC *));
#  146|       for (i = 0; i < nparts; i++)
#  147|->         pixaca[i] = pixacompCreate(0);
#  148|   
#  149|           /* Process each page */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def297]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:212:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixaca’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:145:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:145:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:257:24: note: in expansion of macro ‘ERROR_PTR’
#  210|                   pix4 = pixClipRectangle(pix2, box2, NULL);
#  211|                   pix5 = pixAddTextlines(pix4, bmf, buf, 1, L_ADD_LEFT);
#  212|->                 pixacompAddPix(pixaca[j], pix5, IFF_TIFF_G4);
#  213|                   boxDestroy(&box2);
#  214|                   pixDestroy(&pix4);

Error: CPPCHECK_WARNING (CWE-457): [#def298]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:315: warning[uninitvar]: Uninitialized variable: delta
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def299]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c: scope_hint: In function ‘boxaRemoveVGaps’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:315:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘delta’
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: COMPILER_WARNING (CWE-457): [#def300]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c: scope_hint: In function ‘boxaRemoveVGaps.isra.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:315:5: warning[-Wmaybe-uninitialized]: ‘delta’ may be used uninitialized
#  315 |     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:302:35: note: ‘delta’ was declared here
#  302 | l_int32  nbox, i, y1, h1, y2, h2, delta;
#      |                                   ^~~~~
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def301]
leptonica-1.85.0-build/leptonica-1.85.0/src/partition.c: scope_hint: In function ‘partelCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/partition.c:319:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘partel’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/partition.c:49: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/partition.c:318:24: note: in expansion of macro ‘LEPT_CALLOC’
#  317|   
#  318|       partel = (PARTEL *)LEPT_CALLOC(1, sizeof(PARTEL));
#  319|->     partel->box = boxCopy(box);
#  320|       return partel;
#  321|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def302]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘l_generateFlateDataPdf’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:893:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:111: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:807:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:863:5: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:892:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:892:26: note: in expansion of macro ‘LEPT_CALLOC’
#  891|            * whose type can be inferred from the byte itself.  */
#  892|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  893|->     cid->datacomp = datacomp;
#  894|       cid->type = L_FLATE_ENCODE;
#  895|       cid->cmapdatahex = cmapdatahex;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def303]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘l_generateJpegData’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:970:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:968:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:968:26: note: in expansion of macro ‘LEPT_CALLOC’
#  968|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  969|       if (ascii85flag == 0) {
#  970|->         cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def304]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:972:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:968:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:968:26: note: in expansion of macro ‘LEPT_CALLOC’
#  970|           cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|->         cid->data85 = data85;
#  973|           cid->nbytes85 = nbytes85;
#  974|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def305]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:973:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:968:26: note: in expansion of macro ‘LEPT_CALLOC’
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;
#  973|->         cid->nbytes85 = nbytes85;
#  974|       }
#  975|       cid->type = L_JPEG_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def306]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘l_generateJpegDataMem’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1034:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1032:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1032:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1032|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1033|       if (ascii85flag == 0) {
# 1034|->         cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def307]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1036:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1032:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1032:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1034|           cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|->         cid->data85 = data85;
# 1037|           cid->nbytes85 = nbytes85;
# 1038|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def308]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1037:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1032:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;
# 1037|->         cid->nbytes85 = nbytes85;
# 1038|       }
# 1039|       cid->type = L_JPEG_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def309]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘l_generateJp2kData.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1077:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1076:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1076:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1075|           /* The returned jp2k data in memory is the entire jp2k file */
# 1076|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1077|->     if ((cid->datacomp = l_binaryRead(fname, &nbytes)) == NULL) {
# 1078|           l_CIDataDestroy(&cid);
# 1079|           return (L_COMP_DATA *)ERROR_PTR("data not extracted", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def310]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘l_generateG4Data’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1168:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1166:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1166:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1166|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1167|       if (ascii85flag == 0) {
# 1168|->         cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def311]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1170:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1166:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1166:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1168|           cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|->         cid->data85 = data85;
# 1171|           cid->nbytes85 = nbytes85;
# 1172|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def312]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1171:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1166:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;
# 1171|->         cid->nbytes85 = nbytes85;
# 1172|       }
# 1173|       cid->type = L_G4_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def313]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘pixGenerateFlateData’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1434:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1432:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1432:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1432|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1433|       if (ascii85flag == 0) {
# 1434|->         cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def314]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1436:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1432:26: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1432:26: note: in expansion of macro ‘LEPT_CALLOC’
# 1434|           cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|->         cid->data85 = data85;
# 1437|           cid->nbytes85 = nbytes85;
# 1438|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def315]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘generateOutputDataPdf’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2241:29: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1929:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1979:20: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1979:20: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:1979:20: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2180:24: note: in expansion of macro ‘ERROR_PTR’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 2239|       if (!pnbytes)
# 2240|           return ERROR_INT("&nbytes not defined", __func__, 1);
# 2241|->     nbytes = lpd->xrefloc + strlen(lpd->trailer);
# 2242|       *pnbytes = nbytes;
# 2243|       if ((data = (l_uint8 *)LEPT_CALLOC(nbytes, sizeof(l_uint8))) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def316]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c: scope_hint: In function ‘pdfdataCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2534:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lpd’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2533:25: note: in expansion of macro ‘LEPT_CALLOC’
# 2532|   
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|->     if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def317]
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2535:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lpd’
leptonica-1.85.0-build/leptonica-1.85.0/src/pdfio2.c:2533:25: note: in expansion of macro ‘LEPT_CALLOC’
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|->     lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def318]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c: scope_hint: In function ‘makePixelSumTab8’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c:2363:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c:118: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c:2360:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2361|       for (i = 0; i < 256; i++) {
# 2362|           byte = (l_uint8)i;
# 2363|->         tab[i] = (byte & 0x1) +
# 2364|                    ((byte >> 1) & 0x1) +
# 2365|                    ((byte >> 2) & 0x1) +

Error: GCC_ANALYZER_WARNING (CWE-476): [#def319]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c: scope_hint: In function ‘makePixelCentroidTab8’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c:2401:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix3.c:2399:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2399|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2400|       tab[0] = 0;
# 2401|->     tab[1] = 7;
# 2402|       for (i = 2; i < 4; i++) {
# 2403|           tab[i] = tab[i - 2] + 6;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def320]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixGetAverageTiled’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1748:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘meansq’
# 1746|                   valt = (l_int32)(ave + 0.5);
# 1747|               else if (type == L_ROOT_MEAN_SQUARE)
# 1748|->                 valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|                   valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def321]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1750:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘meansq’
# 1748|                   valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|->                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
# 1751|               SET_DATA_BYTE(lined, j, valt);
# 1752|           }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def322]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1750:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ave’
# 1748|                   valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|->                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
# 1751|               SET_DATA_BYTE(lined, j, valt);
# 1752|           }

Error: COMPILER_WARNING (CWE-457): [#def323]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixGetAverageTiled’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1750:52: warning[-Wmaybe-uninitialized]: ‘ave’ may be used uninitialized
# 1750 |                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
#      |                                                ~~~~^~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1692:27: note: ‘ave’ was declared here
# 1692 | l_float64  sumave, summs, ave, meansq, normfact;
#      |                           ^~~
# 1748|                   valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|->                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
# 1751|               SET_DATA_BYTE(lined, j, valt);
# 1752|           }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def324]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixRowStats’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1877:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘histo’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:91: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1862:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:1862:28: note: in expansion of macro ‘LEPT_CALLOC’
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 1875|           for (i = ystart; i < yend; i++) {
# 1876|               lines = datas + i * wpls;
# 1877|->             memset(histo, 0, 1024);
# 1878|               for (j = xstart; j < xend; j++) {
# 1879|                   val = GET_DATA_BYTE(lines, j);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def325]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixColumnStats’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:2033:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘histo’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:2019:28: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:2019:28: note: in expansion of macro ‘LEPT_CALLOC’
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 2031|           }
# 2032|           for (j = xstart; j < xend; j++) {
# 2033|->             memset(histo, 0, 1024);
# 2034|               for (i = ystart, lines = datas; i < yend; lines += wpls, i++) {
# 2035|                   val = GET_DATA_BYTE(lines, j);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def326]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixGetExtremeValue’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:2235:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pgrayval’
# 2233|               }
# 2234|           }
# 2235|->         *pgrayval = extval;
# 2236|           return 0;
# 2237|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def327]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixGetRowStats.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3149:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gray2bin’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3145:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3146:27: note: in expansion of macro ‘LEPT_CALLOC’
# 3147|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3148|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3149|->         gray2bin[i] = (i * nbins) / 256;
# 3150|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3151|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def328]
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c: scope_hint: In function ‘pixGetColumnStats’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3268:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gray2bin’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3264:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pix4.c:3265:27: note: in expansion of macro ‘LEPT_CALLOC’
# 3266|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3267|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3268|->         gray2bin[i] = (i * nbins) / 256;
# 3269|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3270|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def329]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c: scope_hint: In function ‘pixaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c:175:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixa’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c:139: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c:174:20: note: in expansion of macro ‘LEPT_CALLOC’
#  173|   
#  174|       pixa = (PIXA *)LEPT_CALLOC(1, sizeof(PIXA));
#  175|->     pixa->n = 0;
#  176|       pixa->nalloc = n;
#  177|       pixa->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def330]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c: scope_hint: In function ‘pixaaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c:1766:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘paa’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixabasic.c:1765:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1764|   
# 1765|       paa = (PIXAA *)LEPT_CALLOC(1, sizeof(PIXAA));
# 1766|->     paa->n = 0;
# 1767|       paa->nalloc = n;
# 1768|       if ((paa->pixa = (PIXA **)LEPT_CALLOC(n, sizeof(PIXA *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def331]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixacc.c: scope_hint: In function ‘pixaccCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixacc.c:100:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixacc’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixacc.c:68: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixacc.c:99:24: note: in expansion of macro ‘LEPT_CALLOC’
#   98|   
#   99|       pixacc = (PIXACC *)LEPT_CALLOC(1, sizeof(PIXACC));
#  100|->     pixacc->w = w;
#  101|       pixacc->h = h;
#  102|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def332]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectBySize’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:256:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:100: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:316:24: note: in expansion of macro ‘ERROR_PTR’
#  254|       pixaDestroy(&pixas);
#  255|   
#  256|->     if (!changed) {
#  257|           pixaDestroy(&pixad);
#  258|           return pixCopy(NULL, pixs);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def333]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectByPerimToAreaRatio’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:479:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:529:24: note: in expansion of macro ‘ERROR_PTR’
#  477|       pixaDestroy(&pixas);
#  478|   
#  479|->     if (!changed) {
#  480|           pixaDestroy(&pixad);
#  481|           return pixCopy(NULL, pixs);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def334]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectByPerimSizeRatio’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:606:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:656:24: note: in expansion of macro ‘ERROR_PTR’
#  604|       pixaDestroy(&pixas);
#  605|   
#  606|->     if (!changed) {
#  607|           pixaDestroy(&pixad);
#  608|           return pixCopy(NULL, pixs);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def335]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectByAreaFraction’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:732:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:786:24: note: in expansion of macro ‘ERROR_PTR’
#  730|       pixaDestroy(&pixas);
#  731|   
#  732|->     if (!changed) {
#  733|           pixaDestroy(&pixad);
#  734|           return pixCopy(NULL, pixs);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def336]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectByArea’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:862:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:916:24: note: in expansion of macro ‘ERROR_PTR’
#  860|       pixaDestroy(&pixas);
#  861|   
#  862|->     if (!changed) {
#  863|           pixaDestroy(&pixad);
#  864|           return pixCopy(NULL, pixs);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def337]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c: scope_hint: In function ‘pixSelectByWidthHeightRatio’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:991:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘changed’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc1.c:1045:24: note: in expansion of macro ‘ERROR_PTR’
#  989|       pixaDestroy(&pixas);
#  990|   
#  991|->     if (!changed) {
#  992|           pixaDestroy(&pixad);
#  993|           return pixCopy(NULL, pixs);

Error: CPPCHECK_WARNING (CWE-457): [#def338]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:311: warning[uninitvar]: Uninitialized variable: res
#  309|       }
#  310|   
#  311|->     pixSetResolution(pixd, res, res);
#  312|       return pixd;
#  313|   }

Error: COMPILER_WARNING (CWE-457): [#def339]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayRandomCmap’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:311:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  311 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:271:52: note: ‘res’ was declared here
#  271 | l_int32   i, n, same, maxd, index, xb, yb, wb, hb, res;
#      |                                                    ^~~
#  309|       }
#  310|   
#  311|->     pixSetResolution(pixd, res, res);
#  312|       return pixd;
#  313|   }

Error: CPPCHECK_WARNING (CWE-457): [#def340]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:685: warning[uninitvar]: Uninitialized variable: res
#  683|           }
#  684|       }
#  685|->     pixSetResolution(pixd, res, res);
#  686|   
#  687|       pixaDestroy(&pixa1);

Error: COMPILER_WARNING (CWE-457): [#def341]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayTiled’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:685:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  685 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:623:42: note: ‘res’ was declared here
#  623 | l_int32  wmax, hmax, wd, hd, d, hascmap, res, same;
#      |                                          ^~~
#  683|           }
#  684|       }
#  685|->     pixSetResolution(pixd, res, res);
#  686|   
#  687|       pixaDestroy(&pixa1);

Error: CPPCHECK_WARNING (CWE-457): [#def342]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:988: warning[uninitvar]: Uninitialized variable: res
#  986|       boxaGetExtent(boxa, &w, &h, NULL);
#  987|       pixd = pixaDisplay(pixa2, w + spacing, h + spacing);
#  988|->     pixSetResolution(pixd, res, res);
#  989|   
#  990|           /* Save the boxa in the text field of the output pix */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def343]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayTiledInColumns’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:988:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘res’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:165: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:200:23: note: in expansion of macro ‘ERROR_PTR’
#  986|       boxaGetExtent(boxa, &w, &h, NULL);
#  987|       pixd = pixaDisplay(pixa2, w + spacing, h + spacing);
#  988|->     pixSetResolution(pixd, res, res);
#  989|   
#  990|           /* Save the boxa in the text field of the output pix */

Error: COMPILER_WARNING (CWE-457): [#def344]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayTiledInColumns’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:988:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  988 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/pixafunc2.c:918:75: note: ‘res’ was declared here
#  918 | l_int32   i, j, index, n, x, y, nrows, wb, hb, w, h, maxd, maxh, bordval, res;
#      |                                                                           ^~~
#  986|       boxaGetExtent(boxa, &w, &h, NULL);
#  987|       pixd = pixaDisplay(pixa2, w + spacing, h + spacing);
#  988|->     pixSetResolution(pixd, res, res);
#  989|   
#  990|           /* Save the boxa in the text field of the output pix */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def345]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixalloc.c: scope_hint: In function ‘pmsCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixalloc.c:199:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pms’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixalloc.c:48: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixalloc.c:193:30: note: in expansion of macro ‘LEPT_CALLOC’
#  197|       if (minsize % 4 != 0)
#  198|           minsize -= minsize % 4;
#  199|->     pms->minsize = minsize;
#  200|       nlevels = numaGetCount(numalloc);
#  201|       pms->nlevels = nlevels;

Error: CPPCHECK_WARNING (CWE-628): [#def346]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixarith.c:1569: warning[invalidFunctionArg]: Invalid log() argument nr 1. The value is 0 but the valid values are '4.94066e-324:'.
# 1567|       log2 = (l_float32)log((l_float32)2);
# 1568|       for (i = 0; i < 256; i++)
# 1569|->         tab[i] = (l_float32)log((l_float32)i) / log2;
# 1570|   
# 1571|       return tab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def347]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c: scope_hint: In function ‘pixacompCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:600:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixac’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:156: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:599:22: note: in expansion of macro ‘LEPT_CALLOC’
#  598|   
#  599|       pixac = (PIXAC *)LEPT_CALLOC(1, sizeof(PIXAC));
#  600|->     pixac->n = 0;
#  601|       pixac->nalloc = n;
#  602|       pixac->offset = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def348]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1712:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixc’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1411:21: note: in expansion of macro ‘L_MAX’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1701:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixcomp.c:1711:24: note: in expansion of macro ‘LEPT_CALLOC’
# 1710|           fgetc(fp);  /* swallow the ending nl */
# 1711|           pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
# 1712|->         pixc->w = w;
# 1713|           pixc->h = h;
# 1714|           pixc->d = d;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixRemoveColormap.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:337:16: warning[-Wanalyzer-malloc-leak]: leak of ‘graymap’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:163: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:406:31: note: in expansion of macro ‘LEPT_CALLOC’
#  335|   
#  336|       if (!pixs)
#  337|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
#  338|       if ((cmap = pixGetColormap(pixs)) == NULL)
#  339|           return pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def350]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:408:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘graymap’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:406:31: note: in expansion of macro ‘LEPT_CALLOC’
#  406|           graymap = (l_uint32 *)LEPT_CALLOC(nalloc, sizeof(l_uint32));
#  407|           for (i = 0; i < ncolors; i++) {
#  408|->             graymap[i] = (l_uint32)(L_RED_WEIGHT * rmap[i] +
#  409|                                       L_GREEN_WEIGHT * gmap[i] +
#  410|                                       L_BLUE_WEIGHT * bmap[i] + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def351]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert1To16.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:1969:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:1965:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1967|       val[1] = val1;
# 1968|       for (index = 0; index < 4; index++) {
# 1969|->         tab[index] = (val[(index >> 1) & 1] << 16) | val[index & 1];
# 1970|       }
# 1971|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def352]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert1To2.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2144:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2140:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2142|       val[1] = val1;
# 2143|       for (index = 0; index < 256; index++) {
# 2144|->         tab[index] = (val[(index >> 7) & 1] << 14) |
# 2145|                        (val[(index >> 6) & 1] << 12) |
# 2146|                        (val[(index >> 5) & 1] << 10) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def353]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert1To4.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2261:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2257:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2259|       val[1] = val1;
# 2260|       for (index = 0; index < 256; index++) {
# 2261|->         tab[index] = (val[(index >> 7) & 1] << 28) |
# 2262|                        (val[(index >> 6) & 1] << 24) |
# 2263|                        (val[(index >> 5) & 1] << 20) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def354]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert1To8.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2379:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2375:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2377|       val[1] = val1;
# 2378|       for (index = 0; index < 16; index++) {
# 2379|->         tab[index] = ((l_uint32)val[(index >> 3) & 1] << 24) |
# 2380|                        (val[(index >> 2) & 1] << 16) |
# 2381|                        (val[(index >> 1) & 1] << 8) | val[index & 1];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def355]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert2To8.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2499:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2493:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:2493:23: note: in expansion of macro ‘LEPT_CALLOC’
# 2497|       val[3] = val3;
# 2498|       for (index = 0; index < 256; index++) {
# 2499|->         tab[index] = (val[(index >> 6) & 3] << 24) |
# 2500|                        (val[(index >> 4) & 3] << 16) |
# 2501|                        (val[(index >> 2) & 3] << 8) | val[index & 3];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def356]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c: scope_hint: In function ‘pixConvert8To32.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:3362:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixconv.c:3360:23: note: in expansion of macro ‘LEPT_CALLOC’
# 3360|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 3361|       for (i = 0; i < 256; i++)
# 3362|->       tab[i] = ((l_uint32)i << 24) | (i << 16) | (i << 8);
# 3363|   
# 3364|           /* Replicate 1 --> 4 bytes (alpha byte not set) */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def357]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c: scope_hint: In function ‘pixConnCompIncrAdd’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:400:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘neigh’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:88: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
#  398|           /* Otherwise, there is at least one neighbor.  Add the pixel
#  399|            * to the first neighbor c.c. */
#  400|->     firstindex = neigh[0];
#  401|       pixSetPixel(pixs, x, y, firstindex);
#  402|       ptaaAddPt(ptaa, neigh[0], x, y);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def358]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c: scope_hint: In function ‘pixGetSortedNeighborValues’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:528:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*pneigh’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
#  526|           *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
#  527|           for (i = 0; i < index; i++)
#  528|->             (*pneigh)[i] = neigh[i];
#  529|       }
#  530|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def359]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:528:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘neigh’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixlabel.c:526:30: note: in expansion of macro ‘LEPT_CALLOC’
#  526|           *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
#  527|           for (i = 0; i < index; i++)
#  528|->             (*pneigh)[i] = neigh[i];
#  529|       }
#  530|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def360]
leptonica-1.85.0-build/leptonica-1.85.0/src/pixtiling.c: scope_hint: In function ‘pixTilingCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixtiling.c:159:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pt’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixtiling.c:91: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pixtiling.c:158:23: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pixtiling.c:158:23: note: in expansion of macro ‘LEPT_CALLOC’
#  157|   
#  158|       pt = (PIXTILING *)LEPT_CALLOC(1, sizeof(PIXTILING));
#  159|->     pt->pix = pixClone(pixs);
#  160|       pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;

Error: COMPILER_WARNING (CWE-563): [#def361]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘pixReadStreamPng’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:191:30: warning[-Wunused-but-set-variable]: variable ‘ncolors’ set but not used
#  191 | l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#      |                              ^~~~~~~
#  189|   {
#  190|   l_uint8      byte;
#  191|-> l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#  192|   l_int32      wpl, d, spp, cindex, bitval, bival, quadval, tRNS;
#  193|   l_uint32     png_transforms;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def362]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘pixWriteStreamPng’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1167:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘palette’
/usr/include/libpng16/pngconf.h:51: included_from: Included from here.
/usr/include/libpng16/png.h:334: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:132: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:125: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1164:31: note: in expansion of macro ‘LEPT_CALLOC’
# 1165|           pixcmapToArrays(cmap, &rmap, &gmap, &bmap, &amap);
# 1166|           for (i = 0; i < ncolors; i++) {
# 1167|->             palette[i].red = (png_byte)rmap[i];
# 1168|               palette[i].green = (png_byte)gmap[i];
# 1169|               palette[i].blue = (png_byte)bmap[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def363]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1238:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘row_pointers’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1234:37: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1234:37: note: in expansion of macro ‘LEPT_CALLOC’
# 1236|           data = pixGetData(pix1);
# 1237|           for (i = 0; i < h; i++)
# 1238|->             row_pointers[i] = (png_bytep)(data + i * wpl);
# 1239|           png_set_rows(png_ptr, info_ptr, row_pointers);
# 1240|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def364]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1263:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rowbuffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1259:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1259:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1263:34: note: in expansion of macro ‘GET_DATA_BYTE’
# 1261|               ppixel = data + i * wpl;
# 1262|               for (j = k = 0; j < w; j++) {
# 1263|->                 rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_RED);
# 1264|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_GREEN);
# 1265|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def365]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘memio_png_write_data’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1394:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*((struct MemIOData *)last).m_Buffer’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1393:38: note: in expansion of macro ‘LEPT_MALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1393:38: note: in expansion of macro ‘LEPT_MALLOC’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1392|           if (len > MEMIO_BUFFER_SIZE) {
# 1393|               last->m_Buffer = (char *)LEPT_MALLOC(len);
# 1394|->             memcpy(last->m_Buffer, data, len);
# 1395|               last->m_Size = last->m_Count = len;
# 1396|               return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def366]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1406:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘next’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1405:44: note: in expansion of macro ‘LEPT_MALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1405:44: note: in expansion of macro ‘LEPT_MALLOC’
# 1404|           if (last->m_Count == last->m_Size) {
# 1405|               MEMIODATA* next = (MEMIODATA *)LEPT_MALLOC(sizeof(MEMIODATA));
# 1406|->             next->m_Next = NULL;
# 1407|               next->m_Count = 0;
# 1408|               next->m_Last = next;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def367]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘memio_png_flush’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1467:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1466:20: note: in expansion of macro ‘LEPT_MALLOC’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1465|           /* Copy data to a new buffer. */
# 1466|       data = (char *)LEPT_MALLOC(amount);
# 1467|->     memcpy(data, pthing->m_Buffer, pthing->m_Count);
# 1468|       copied = pthing->m_Count;
# 1469|   

Error: COMPILER_WARNING (CWE-563): [#def368]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘pixReadMemPng’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:1576:30: warning[-Wunused-but-set-variable]: variable ‘ncolors’ set but not used
# 1576 | l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#      |                              ^~~~~~~
# 1574|   {
# 1575|   l_uint8      byte;
# 1576|-> l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
# 1577|   l_int32      wpl, d, spp, cindex, bitval, bival, quadval, tRNS;
# 1578|   l_uint32     png_transforms;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def369]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c: scope_hint: In function ‘pixWriteMemPng’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2085:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘palette’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2082:31: note: in expansion of macro ‘LEPT_CALLOC’
# 2083|           pixcmapToArrays(cmap, &rmap, &gmap, &bmap, &amap);
# 2084|           for (i = 0; i < ncolors; i++) {
# 2085|->             palette[i].red = (png_byte)rmap[i];
# 2086|               palette[i].green = (png_byte)gmap[i];
# 2087|               palette[i].blue = (png_byte)bmap[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def370]
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2175:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rowbuffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2171:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2171:32: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/pngio.c:2175:34: note: in expansion of macro ‘GET_DATA_BYTE’
# 2173|               ppixel = data + i * wpl;
# 2174|               for (j = k = 0; j < w; j++) {
# 2175|->                 rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_RED);
# 2176|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_GREEN);
# 2177|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_BLUE);

Error: COMPILER_WARNING (CWE-563): [#def371]
leptonica-1.85.0-build/leptonica-1.85.0/src/pnmio.c: scope_hint: In function ‘pnmReadNextAsciiValue’
leptonica-1.85.0-build/leptonica-1.85.0/src/pnmio.c:1330:10: warning[-Wunused-variable]: unused variable ‘ignore’
# 1330 | l_int32  ignore;
#      |          ^~~~~~
# 1328|                         l_int32  *pval)
# 1329|   {
# 1330|-> l_int32  ignore;
# 1331|   
# 1332|       if (!pval)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def372]
leptonica-1.85.0-build/leptonica-1.85.0/src/psio1.c: scope_hint: In function ‘pixWriteSegmentedPageToPS’
leptonica-1.85.0-build/leptonica-1.85.0/src/psio1.c:666:39: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘d’
#  664|                   pixmis = pixScale(pixm, imagescale, imagescale);
#  665|                   pixmi = pixInvert(NULL, pixmis);
#  666|->                 val = (d == 8) ? 0xff : 0xffffff00;
#  667|                   pixc = pixCopy(NULL, pixsc);
#  668|                   pixSetMasked(pixc, pixmi, val);  /* clear non-image part */

Error: COMPILER_WARNING (CWE-457): [#def373]
leptonica-1.85.0-build/leptonica-1.85.0/src/psio1.c: scope_hint: In function ‘pixWriteSegmentedPageToPS’
leptonica-1.85.0-build/leptonica-1.85.0/src/psio1.c:666:39: warning[-Wmaybe-uninitialized]: ‘d’ may be used uninitialized
#  666 |                 val = (d == 8) ? 0xff : 0xffffff00;
#      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/psio1.c:586:29: note: ‘d’ was declared here
#  586 | l_int32    alltext, notext, d, ret;
#      |                             ^
#  664|                   pixmis = pixScale(pixm, imagescale, imagescale);
#  665|                   pixmi = pixInvert(NULL, pixmis);
#  666|->                 val = (d == 8) ? 0xff : 0xffffff00;
#  667|                   pixc = pixCopy(NULL, pixsc);
#  668|                   pixSetMasked(pixc, pixmi, val);  /* clear non-image part */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def374]
leptonica-1.85.0-build/leptonica-1.85.0/src/psio2.c: scope_hint: In function ‘pixWriteMemPS’
leptonica-1.85.0-build/leptonica-1.85.0/src/psio2.c:1936:14: warning[-Wanalyzer-null-argument]: use of NULL ‘*pdata’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 1934|   
# 1935|       *pdata = (l_uint8 *)pixWriteStringPS(pix, box, res, scale);
# 1936|->     *psize = strlen((char *)(*pdata));
# 1937|       return 0;
# 1938|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def375]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c: scope_hint: In function ‘ptaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c:128:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pta’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c:98: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c:127:18: note: in expansion of macro ‘LEPT_CALLOC’
#  126|   
#  127|       pta = (PTA *)LEPT_CALLOC(1, sizeof(PTA));
#  128|->     pta->n = 0;
#  129|       pta->nalloc = n;
#  130|       pta->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def376]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c: scope_hint: In function ‘ptaaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c:914:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ptaa’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptabasic.c:913:20: note: in expansion of macro ‘LEPT_CALLOC’
#  912|   
#  913|       ptaa = (PTAA *)LEPT_CALLOC(1, sizeof(PTAA));
#  914|->     ptaa->n = 0;
#  915|       ptaa->nalloc = n;
#  916|       if ((ptaa->pta = (PTA **)LEPT_CALLOC(n, sizeof(PTA *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def377]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c: scope_hint: In function ‘ptaGetQuadraticLSF’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1208:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[0]’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:107: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1206|       for (i = 0; i < 3; i++)
# 1207|           f[i] = (l_float32 *)LEPT_CALLOC(3, sizeof(l_float32));
# 1208|->     f[0][0] = sx4;
# 1209|       f[0][1] = sx3;
# 1210|       f[0][2] = sx2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def378]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1211:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[1]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1209|       f[0][1] = sx3;
# 1210|       f[0][2] = sx2;
# 1211|->     f[1][0] = sx3;
# 1212|       f[1][1] = sx2;
# 1213|       f[1][2] = sx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def379]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1214:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[2]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1207:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1212|       f[1][1] = sx2;
# 1213|       f[1][2] = sx;
# 1214|->     f[2][0] = sx2;
# 1215|       f[2][1] = sx;
# 1216|       f[2][2] = n;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def380]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c: scope_hint: In function ‘ptaGetCubicLSF’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1324:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[0]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1322|       for (i = 0; i < 4; i++)
# 1323|           f[i] = (l_float32 *)LEPT_CALLOC(4, sizeof(l_float32));
# 1324|->     f[0][0] = sx6;
# 1325|       f[0][1] = sx5;
# 1326|       f[0][2] = sx4;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def381]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1328:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[1]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1326|       f[0][2] = sx4;
# 1327|       f[0][3] = sx3;
# 1328|->     f[1][0] = sx5;
# 1329|       f[1][1] = sx4;
# 1330|       f[1][2] = sx3;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def382]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1332:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[2]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1330|       f[1][2] = sx3;
# 1331|       f[1][3] = sx2;
# 1332|->     f[2][0] = sx4;
# 1333|       f[2][1] = sx3;
# 1334|       f[2][2] = sx2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def383]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1336:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[3]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1323:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1334|       f[2][2] = sx2;
# 1335|       f[2][3] = sx;
# 1336|->     f[3][0] = sx3;
# 1337|       f[3][1] = sx2;
# 1338|       f[3][2] = sx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def384]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c: scope_hint: In function ‘ptaGetQuarticLSF’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1459:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[0]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1457|       for (i = 0; i < 5; i++)
# 1458|           f[i] = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
# 1459|->     f[0][0] = sx8;
# 1460|       f[0][1] = sx7;
# 1461|       f[0][2] = sx6;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def385]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1464:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[1]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1462|       f[0][3] = sx5;
# 1463|       f[0][4] = sx4;
# 1464|->     f[1][0] = sx7;
# 1465|       f[1][1] = sx6;
# 1466|       f[1][2] = sx5;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def386]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1469:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[2]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1467|       f[1][3] = sx4;
# 1468|       f[1][4] = sx3;
# 1469|->     f[2][0] = sx6;
# 1470|       f[2][1] = sx5;
# 1471|       f[2][2] = sx4;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def387]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1474:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[3]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1472|       f[2][3] = sx3;
# 1473|       f[2][4] = sx2;
# 1474|->     f[3][0] = sx5;
# 1475|       f[3][1] = sx4;
# 1476|       f[3][2] = sx3;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def388]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1479:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[4]’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptafunc1.c:1458:29: note: in expansion of macro ‘LEPT_CALLOC’
# 1477|       f[3][3] = sx2;
# 1478|       f[3][4] = sx;
# 1479|->     f[4][0] = sx4;
# 1480|       f[4][1] = sx3;
# 1481|       f[4][2] = sx2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def389]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c: scope_hint: In function ‘ptraCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:155:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pa’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:125: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:154:20: note: in expansion of macro ‘LEPT_CALLOC’
#  153|   
#  154|       pa = (L_PTRA *)LEPT_CALLOC(1, sizeof(L_PTRA));
#  155|->     if ((pa->array = (void **)LEPT_CALLOC(n, sizeof(void *))) == NULL) {
#  156|           ptraDestroy(&pa, 0, 0);
#  157|           return (L_PTRA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def390]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c: scope_hint: In function ‘ptraDestroy’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:208:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nactual’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:379:49: note: in definition of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:157:26: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:713:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:713:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:713:16: note: in expansion of macro ‘ERROR_INT’
#  206|   
#  207|       ptraGetActualCount(pa, &nactual);
#  208|->     if (nactual > 0) {
#  209|           if (freeflag) {
#  210|               for (i = 0; i <= pa->imax; i++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def391]
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c: scope_hint: In function ‘ptraaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:776:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘paa’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:775:22: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/ptra.c:775:22: note: in expansion of macro ‘LEPT_CALLOC’
#  774|   
#  775|       paa = (L_PTRAA *)LEPT_CALLOC(1, sizeof(L_PTRAA));
#  776|->     if ((paa->ptra = (L_PTRA **)LEPT_CALLOC(n, sizeof(L_PTRA *))) == NULL) {
#  777|           ptraaDestroy(&paa, 0, 0);
#  778|           return (L_PTRAA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def392]
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c: scope_hint: In function ‘boxaaQuadtreeRegions’
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:471:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xstart’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:69: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:464:25: note: in expansion of macro ‘LEPT_CALLOC’
#  469|           nside = 1 << k;  /* number of boxes in each direction */
#  470|           for (i = 0; i < nside; i++) {
#  471|->             xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def393]
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:473:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xend’
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:465:23: note: in expansion of macro ‘LEPT_CALLOC’
#  471|               xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|->             xend[i] = (w - 1) * (i + 1) / nside;
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def394]
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:474:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ystart’
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:466:25: note: in expansion of macro ‘LEPT_CALLOC’
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;
#  474|->             ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|               yend[i] = (h - 1) * (i + 1) / nside;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def395]
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:476:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘yend’
leptonica-1.85.0-build/leptonica-1.85.0/src/quadtree.c:467:23: note: in expansion of macro ‘LEPT_CALLOC’
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|->             yend[i] = (h - 1) * (i + 1) / nside;
#  477|   #if DEBUG_BOXES
#  478|               lept_stderr(

Error: GCC_ANALYZER_WARNING (CWE-476): [#def396]
leptonica-1.85.0-build/leptonica-1.85.0/src/queue.c: scope_hint: In function ‘lqueueCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/queue.c:101:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lq’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/queue.c:70: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/queue.c:100:21: note: in expansion of macro ‘LEPT_CALLOC’
#   99|   
#  100|       lq = (L_QUEUE *)LEPT_CALLOC(1, sizeof(L_QUEUE));
#  101|->     if ((lq->array = (void **)LEPT_CALLOC(nalloc, sizeof(void *))) == NULL) {
#  102|           lqueueDestroy(&lq, 0);
#  103|           return (L_QUEUE *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def397]
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c: scope_hint: In function ‘pixRankFilterGray.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:333:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘histo’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:125: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:314:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:314:24: note: in expansion of macro ‘LEPT_CALLOC’
#  331|                   /* Start each column with clean histogram arrays. */
#  332|               for (n = 0; n < 256; n++)
#  333|->                 histo[n] = 0;
#  334|               for (n = 0; n < 16; n++)
#  335|                   histo16[n] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def398]
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:393:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘histo’
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:314:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/rank.c:314:24: note: in expansion of macro ‘LEPT_CALLOC’
#  391|                   /* Start each row with clean histogram arrays. */
#  392|               for (n = 0; n < 256; n++)
#  393|->                 histo[n] = 0;
#  394|               for (n = 0; n < 16; n++)
#  395|                   histo16[n] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def399]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘rotate_left’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:636:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘n’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘rotate_left’
#  634|   
#  635|   static void rotate_left(L_RBTREE *t, node *n) {
#  636|->     node *r = n->right;
#  637|       replace_node(t, n, r);
#  638|       n->right = r->left;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def400]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘rotate_right’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:647:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘n’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘rotate_right’
#  645|   
#  646|   static void rotate_right(L_RBTREE *t, node *n) {
#  647|->     node *L = n->left;
#  648|       replace_node(t, n, L);
#  649|       n->left = L->right;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def401]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case3’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:752:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case3’
#  750|       if (node_color(n->parent) == L_BLACK_NODE &&
#  751|           node_color(sibling(n)) == L_BLACK_NODE &&
#  752|->         node_color(sibling(n)->left) == L_BLACK_NODE &&
#  753|           node_color(sibling(n)->right) == L_BLACK_NODE) {
#  754|           sibling(n)->color = L_RED_NODE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def402]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case5’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:779:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case5’
#  777|           node_color(sibling(n)->right) == L_BLACK_NODE) {
#  778|           sibling(n)->color = L_RED_NODE;
#  779|->         sibling(n)->left->color = L_BLACK_NODE;
#  780|           rotate_right(t, sibling(n));
#  781|       } else if (n == n->parent->right &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def403]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:786:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case5’
#  784|                  node_color(sibling(n)->left) == L_BLACK_NODE) {
#  785|           sibling(n)->color = L_RED_NODE;
#  786|->         sibling(n)->right->color = L_BLACK_NODE;
#  787|           rotate_left(t, sibling(n));
#  788|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def404]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case6’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:793:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case6’
#  791|   
#  792|   static void delete_case6(L_RBTREE *t, node *n) {
#  793|->     sibling(n)->color = node_color(n->parent);
#  794|       n->parent->color = L_BLACK_NODE;
#  795|       if (n == n->parent->left) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def405]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:796:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case6’
#  794|       n->parent->color = L_BLACK_NODE;
#  795|       if (n == n->parent->left) {
#  796|->         if (node_color(sibling(n)->right) != L_RED_NODE) {
#  797|               L_ERROR("right sibling is not RED", "delete_case6");
#  798|               return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def406]
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c:803:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.85.0-build/leptonica-1.85.0/src/rbtree.c: scope_hint: In function ‘delete_case6’
#  801|           rotate_left(t, n->parent);
#  802|       } else {
#  803|->         if (node_color(sibling(n)->left) != L_RED_NODE) {
#  804|               L_ERROR("left sibling is not RED", "delete_case6");
#  805|               return;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def407]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.c: scope_hint: In function ‘numaLocatePeakRanges’
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.c:1111:28: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘left’
# 1109|               left = i;
# 1110|           } else if (inpeak == TRUE && val <= maxmin) {  /* end peak */
# 1111|->             center = (left + i - 1.0) / 2.0;
# 1112|               if (center - prevcenter >= minsep) {  /* save new peak */
# 1113|                   inpeak = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def408]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.c:1123:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘left’
# 1121|       }
# 1122|       if (inpeak == TRUE) {  /* save the last peak */
# 1123|->         numaAddNumber(nad, left);
# 1124|           numaAddNumber(nad, n - 1);
# 1125|       }

Error: COMPILER_WARNING (CWE-563): [#def409]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:78:21: warning[-Wunused-variable]: ‘SupportedBarcodeFormatName’ defined but not used
#   78 | static const char  *SupportedBarcodeFormatName[] = {
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
#   76|   
#   77|   /*! Currently supported format names */
#   78|-> static const char  *SupportedBarcodeFormatName[] = {
#   79|       "Code2of5",
#   80|       "CodeI2of5",

Error: COMPILER_WARNING (CWE-563): [#def410]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:93:20: warning[-Wunused-variable]: ‘Code2of5’ defined but not used
#   93 | static const char *Code2of5[] = {
#      |                    ^~~~~~~~
#   91|        *                       Code 2 of 5 symbology                       *
#   92|        * ----------------------------------------------------------------- */
#   93|-> static const char *Code2of5[] = {
#   94|       "111121211", "211111112", "112111112", "212111111",   /* 0 - 3 */
#   95|       "111121112", "211121111", "112121111", "111111212",   /* 4 - 7 */

Error: COMPILER_WARNING (CWE-563): [#def411]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:107:20: warning[-Wunused-variable]: ‘CodeI2of5’ defined but not used
#  107 | static const char *CodeI2of5[] = {
#      |                    ^~~~~~~~~
#  105|        *                Code Interleaved 2 of 5 symbology                  *
#  106|        * ----------------------------------------------------------------- */
#  107|-> static const char *CodeI2of5[] = {
#  108|       "11221", "21112", "12112", "22111", "11212",    /*  0 - 4 */
#  109|       "21211", "12211", "11122", "21121", "12121",    /*  5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def412]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:120:20: warning[-Wunused-variable]: ‘Code93’ defined but not used
#  120 | static const char *Code93[] = {
#      |                    ^~~~~~
#  118|        *                         Code 93 symbology                         *
#  119|        * ----------------------------------------------------------------- */
#  120|-> static const char *Code93[] = {
#  121|       "131112", "111213", "111312", "111411", "121113", /* 0: 0 - 4 */
#  122|       "121212", "121311", "111114", "131211", "141111", /* 5: 5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def413]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:144:20: warning[-Wunused-variable]: ‘Code39’ defined but not used
#  144 | static const char *Code39[] = {
#      |                    ^~~~~~
#  142|        *                         Code 39 symbology                         *
#  143|        * ----------------------------------------------------------------- */
#  144|-> static const char *Code39[] = {
#  145|       "111221211", "211211112", "112211112", "212211111",  /* 0: 0 - 3      */
#  146|       "111221112", "211221111", "112221111", "111211212",  /* 4: 4 - 7      */

Error: COMPILER_WARNING (CWE-563): [#def414]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:169:20: warning[-Wunused-variable]: ‘Codabar’ defined but not used
#  169 | static const char *Codabar[] = {
#      |                    ^~~~~~~
#  167|        *                         Codabar symbology                         *
#  168|        * ----------------------------------------------------------------- */
#  169|-> static const char *Codabar[] = {
#  170|       "1111122", "1111221", "1112112", "2211111", "1121121", /* 0: 0 - 4      */
#  171|       "2111121", "1211112", "1211211", "1221111", "2112111", /* 5: 5 - 9      */

Error: COMPILER_WARNING (CWE-563): [#def415]
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:184:20: warning[-Wunused-variable]: ‘Upca’ defined but not used
#  184 | static const char *Upca[] = {
#      |                    ^~~~
#  182|        *                          UPC-A symbology                          *
#  183|        * ----------------------------------------------------------------- */
#  184|-> static const char *Upca[] = {
#  185|       "3211", "2221", "2122", "1411", "1132",  /* 0: 0 - 4              */
#  186|       "1231", "1114", "1312", "1213", "3112",  /* 5: 5 - 9              */

Error: COMPILER_WARNING (CWE-563): [#def416]
leptonica-1.85.0-build/leptonica-1.85.0/src/bardecode.c:68: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/readbarcode.h:198:20: warning[-Wunused-variable]: ‘Code128’ defined but not used
#  198 | static const char *Code128[] = {
#      |                    ^~~~~~~
#  196|        *                         Code128 symbology                         *
#  197|        * ----------------------------------------------------------------- */
#  198|-> static const char *Code128[] = {
#  199|       "212222", "222122", "222221", "121223", "121322",    /*  0 - 4 */
#  200|       "131222", "122213", "122312", "132212", "221213",    /*  5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def417]
leptonica-1.85.0-build/leptonica-1.85.0/src/readfile.c:96:20: warning[-Wunused-variable]: ‘FILE_JP2K’ defined but not used
#   96 | static const char *FILE_JP2K =  "/tmp/lept/format/file.jp2";
#      |                    ^~~~~~~~~
#   94|   static const char *FILE_GIF  =  "/tmp/lept/format/file.gif";
#   95|   static const char *FILE_WEBP =  "/tmp/lept/format/file.webp";
#   96|-> static const char *FILE_JP2K =  "/tmp/lept/format/file.jp2";
#   97|   
#   98|       /* There are two jp2 formats, and two codecs associated with them:

Error: CPPCHECK_WARNING (CWE-457): [#def418]
leptonica-1.85.0-build/leptonica-1.85.0/src/readfile.c:672: error[uninitvar]: Uninitialized variable: twobytepw
#  670|       ((char *)(&twobytepw))[1] = buf[1];
#  671|   
#  672|->     if (convertOnBigEnd16(twobytepw) == BMP_ID) {
#  673|           *pformat = IFF_BMP;
#  674|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def419]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogbasic.c: scope_hint: In function ‘recogCreate.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogbasic.c:434:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘recog’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogbasic.c:194: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogbasic.c:432:24: note: in expansion of macro ‘LEPT_CALLOC’
#  432|       recog = (L_RECOG *)LEPT_CALLOC(1, sizeof(L_RECOG));
#  433|       recog->templ_use = L_USE_ALL_TEMPLATES;  /* default */
#  434|->     recog->threshold = threshold;
#  435|       recog->scalew = scalew;
#  436|       recog->scaleh = scaleh;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def420]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c: scope_hint: In function ‘recogCreateDid’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c:783:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)*did.narray, 8)’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c:162: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c:776:31: note: in expansion of macro ‘LEPT_CALLOC’
#  781|       did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  782|       for (i = 0; i < did->narray; i++) {
#  783|->         did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  784|           did->delya[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  785|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def421]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c:784:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)*did.narray, 8)’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogdid.c:777:30: note: in expansion of macro ‘LEPT_CALLOC’
#  782|       for (i = 0; i < did->narray; i++) {
#  783|           did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  784|->         did->delya[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  785|       }
#  786|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def422]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c: scope_hint: In function ‘pixCorrelationBestShift’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:787:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘area1’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:97: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:778:24: note: in expansion of macro ‘LEPT_CALLOC’
#  785|       }
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|->         area1[i] = sum;
#  788|           ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def423]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:788:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:779:27: note: in expansion of macro ‘LEPT_CALLOC’
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|           area1[i] = sum;
#  788|->         ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];
#  790|           moment += arraymoment[w2 + i] - arraymoment[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def424]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:807:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:779:27: note: in expansion of macro ‘LEPT_CALLOC’
#  805|       dely = 0;  /* amount to shift pix2 relative to pix1 to get alignment */
#  806|       for (i = 0; i < nx; i++) {
#  807|->         shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|               pixClearAll(pixt);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def425]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:814:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘area1’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:778:24: note: in expansion of macro ‘LEPT_CALLOC’
#  812|               pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /
#  814|->                     ((l_float32)area1[i] * (l_float32)area2);
#  815|               if (score > maxscore) {
#  816|                   maxscore = score;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def426]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c: scope_hint: In function ‘rchaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1140:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rcha’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1139:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1138|   
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|->     rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def427]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1211:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rch’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c: scope_hint: In function ‘recogIdentifyPix’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1210:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1209|   
# 1210|       rch = (L_RCH *)LEPT_CALLOC(1, sizeof(L_RCH));
# 1211|->     rch->index = index;
# 1212|       rch->score = score;
# 1213|       rch->text = text;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def428]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1212:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rch’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c: scope_hint: In function ‘recogSkipIdentify’
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1210:20: note: in expansion of macro ‘LEPT_CALLOC’
# 1210|       rch = (L_RCH *)LEPT_CALLOC(1, sizeof(L_RCH));
# 1211|       rch->index = index;
# 1212|->     rch->score = score;
# 1213|       rch->text = text;
# 1214|       rch->sample = sample;

Error: CPPCHECK_WARNING (CWE-476): [#def429]
leptonica-1.85.0-build/leptonica-1.85.0/src/recogident.c:1783: warning[nullPointer]: Possible null pointer dereference: scorestr
# 1781|                if (j < nchar - 1) stringJoinIP(&scorestr, ",");
# 1782|           }
# 1783|->         snprintf(buf, sizeof(buf), "%s: %s\n", textstr, scorestr);
# 1784|           pix4 = pixAddTextlines(pix3, bmf, buf, 0xff000000, L_ADD_BELOW);
# 1785|           pixaAddPix(pixa, pix4, L_INSERT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def430]
leptonica-1.85.0-build/leptonica-1.85.0/src/regutils.c: scope_hint: In function ‘regTestSetup’
leptonica-1.85.0-build/leptonica-1.85.0/src/regutils.c:144:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rp’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/regutils.c:73: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/regutils.c:142:25: note: in expansion of macro ‘LEPT_CALLOC’
#  142|       rp = (L_REGPARAMS *)LEPT_CALLOC(1, sizeof(L_REGPARAMS));
#  143|       *prp = rp;
#  144|->     rp->testname = testname;
#  145|       rp->index = -1;  /* increment before each test */
#  146|   

Error: COMPILER_WARNING (CWE-1164): [#def431]
leptonica-1.85.0-build/leptonica-1.85.0/src/rop.c:541:1: warning[-Wunused-function]: ‘checkRasteropCrop’ defined but not used
#  541 | checkRasteropCrop(l_int32 pixw,
#      | ^~~~~~~~~~~~~~~~~
#  539|    */
#  540|   static l_int32
#  541|-> checkRasteropCrop(l_int32 pixw,
#  542|                     l_int32 pixh,
#  543|                     l_int32 x,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def432]
leptonica-1.85.0-build/leptonica-1.85.0/src/roplow.c: scope_hint: In function ‘rasteropVipLow’
leptonica-1.85.0-build/leptonica-1.85.0/src/roplow.c:2251:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fwmask’
# 2249|       } else {  /* if so */
# 2250|           fwpart2b = 1;
# 2251|->         fwmask &= lmask32[32 - fwbits + w];
# 2252|       }
# 2253|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def433]
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c: scope_hint: In function ‘makeReverseByteTab1’
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:653:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:58: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:651:22: note: in expansion of macro ‘LEPT_CALLOC’
#  651|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  652|       for (i = 0; i < 256; i++)
#  653|->         tab[i] = ((0x80 & i) >> 7) |
#  654|                    ((0x40 & i) >> 5) |
#  655|                    ((0x20 & i) >> 3) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def434]
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c: scope_hint: In function ‘makeReverseByteTab2’
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:680:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:678:22: note: in expansion of macro ‘LEPT_CALLOC’
#  678|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  679|       for (i = 0; i < 256; i++)
#  680|->         tab[i] = ((0xc0 & i) >> 6) |
#  681|                    ((0x30 & i) >> 2) |
#  682|                    ((0x0c & i) << 2) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def435]
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c: scope_hint: In function ‘makeReverseByteTab4’
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:703:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/rotateorth.c:701:22: note: in expansion of macro ‘LEPT_CALLOC’
#  701|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  702|       for (i = 0; i < 256; i++)
#  703|->         tab[i] = ((0xf0 & i) >> 4) | ((0x0f & i) << 4);
#  704|       return tab;
#  705|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def436]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:65: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c: scope_hint: In function ‘pixRunlengthTransform.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:313:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:298:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:730:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
#  311|               if (depth == 8) {
#  312|                   for (j = 0; j < w; j++)
#  313|->                     SET_DATA_BYTE(lined, j, buffer[j]);
#  314|               } else {  /* depth == 16 */
#  315|                   for (j = 0; j < w; j++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def437]
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:316:56: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:223:77: note: in definition of macro ‘SET_DATA_TWO_BYTES’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:298:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:730:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:223:77: note: in definition of macro ‘SET_DATA_TWO_BYTES’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:223:77: note: in definition of macro ‘SET_DATA_TWO_BYTES’
#  314|               } else {  /* depth == 16 */
#  315|                   for (j = 0; j < w; j++)
#  316|->                     SET_DATA_TWO_BYTES(lined, j, buffer[j]);
#  317|               }
#  318|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def438]
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:326:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:274:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:298:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:730:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
#  324|                   for (i = 0; i < h; i++) {
#  325|                       lined = datad + i * wpld;
#  326|->                     SET_DATA_BYTE(lined, j, buffer[i]);
#  327|                   }
#  328|               } else {  /* depth == 16 */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def439]
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:331:56: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buffer’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:223:77: note: in definition of macro ‘SET_DATA_TWO_BYTES’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:274:23: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:298:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/runlength.c:730:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:223:77: note: in definition of macro ‘SET_DATA_TWO_BYTES’
#  329|                   for (i = 0; i < h; i++) {
#  330|                       lined = datad + i * wpld;
#  331|->                     SET_DATA_TWO_BYTES(lined, j, buffer[i]);
#  332|                   }
#  333|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def440]
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c: scope_hint: In function ‘sarrayCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:177:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sa’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:149: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:176:20: note: in expansion of macro ‘LEPT_CALLOC’
#  175|   
#  176|       sa = (SARRAY *)LEPT_CALLOC(1, sizeof(SARRAY));
#  177|->     if ((sa->array = (char **)LEPT_CALLOC(n, sizeof(char *))) == NULL) {
#  178|           sarrayDestroy(&sa);
#  179|           return (SARRAY *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def441]
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c: scope_hint: In function ‘sarrayDestroy’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:375:10: warning[-Wanalyzer-malloc-leak]: leak of ‘sa’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:176:20: note: in expansion of macro ‘LEPT_CALLOC’
#  373|           LEPT_FREE(sa);
#  374|       }
#  375|->     *psa = NULL;
#  376|   }
#  377|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def442]
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c: scope_hint: In function ‘sarraySelectBySubstring.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:1173:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:678:24: note: in expansion of macro ‘ERROR_PTR’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 1171|       for (i = 0; i < n; i++) {
# 1172|           str = sarrayGetString(sain, i, L_NOCOPY);
# 1173|->         arrayFindSequence((l_uint8 *)str, strlen(str), (l_uint8 *)substr,
# 1174|                             strlen(substr), &offset, &found);
# 1175|           if (found)

Error: COMPILER_WARNING (CWE-563): [#def443]
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c: scope_hint: In function ‘sarrayReadStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:1390:47: warning[-Wunused-but-set-variable]: variable ‘ignore’ set but not used
# 1390 | l_int32  i, n, size, index, bufsize, version, ignore, success;
#      |                                               ^~~~~~
# 1388|   {
# 1389|   char    *stringbuf;
# 1390|-> l_int32  i, n, size, index, bufsize, version, ignore, success;
# 1391|   SARRAY  *sa;
# 1392|   

Error: COMPILER_WARNING (CWE-563): [#def444]
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c: scope_hint: In function ‘getFilenamesInDirectory’
leptonica-1.85.0-build/leptonica-1.85.0/src/sarray1.c:1888:17: warning[-Wunused-variable]: unused variable ‘dfd’
# 1888 | int             dfd, stat_ret;
#      |                 ^~~
# 1886|   DIR            *pdir;
# 1887|   struct dirent  *pdirentry;
# 1888|-> int             dfd, stat_ret;
# 1889|   struct stat     st;
# 1890|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def445]
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:103: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘pixScaleGrayMinMax’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1067:48: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minval’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
# 1065|                   SET_DATA_BYTE(lined, j, maxval);
# 1066|               else  /* type == L_CHOOSE_MAXDIFF */
# 1067|->                 SET_DATA_BYTE(lined, j, maxval - minval);
# 1068|           }
# 1069|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def446]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘pixScaleGrayMinMax2’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1157:48: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minval’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:70: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
# 1155|                   SET_DATA_BYTE(lined, j, maxval);
# 1156|               else  /* type == L_CHOOSE_MAXDIFF */
# 1157|->                 SET_DATA_BYTE(lined, j, maxval - minval);
# 1158|           }
# 1159|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def447]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeSumTabSG2’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1580:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1578:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1578|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1579|       for (i = 0; i < 256; i++) {
# 1580|->         tab[i] = (sum[i & 0x3] | sum[(i >> 2) & 0x3] << 8 |
# 1581|                     sum[(i >> 4) & 0x3] << 16 | sum[(i >> 6) & 0x3] << 24);
# 1582|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def448]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeValTabSG2’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1606:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1604:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1604|       tab = (l_uint8 *)LEPT_CALLOC(5, sizeof(l_uint8));
# 1605|       for (i = 0; i < 5; i++)
# 1606|->         tab[i] = 255 - (i * 255) / 4;
# 1607|       return tab;
# 1608|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def449]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeSumTabSG3’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1735:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1733:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1733|       tab = (l_uint32 *)LEPT_CALLOC(64, sizeof(l_uint32));
# 1734|       for (i = 0; i < 64; i++) {
# 1735|->         tab[i] = (sum[i & 0x07]) | (sum[(i >> 3) & 0x07] << 8);
# 1736|       }
# 1737|       return tab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def450]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeValTabSG3’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1760:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1758:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1758|       tab = (l_uint8 *)LEPT_CALLOC(10, sizeof(l_uint8));
# 1759|       for (i = 0; i < 10; i++)
# 1760|->         tab[i] = 0xff - (i * 255) / 9;
# 1761|       return tab;
# 1762|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def451]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeSumTabSG4’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1852:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1850:23: note: in expansion of macro ‘LEPT_CALLOC’
# 1850|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1851|       for (i = 0; i < 256; i++) {
# 1852|->         tab[i] = (sum[i & 0xf]) | (sum[(i >> 4) & 0xf] << 8);
# 1853|       }
# 1854|       return tab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def452]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeValTabSG4’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1877:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:1875:22: note: in expansion of macro ‘LEPT_CALLOC’
# 1875|       tab = (l_uint8 *)LEPT_CALLOC(17, sizeof(l_uint8));
# 1876|       for (i = 0; i < 17; i++)
# 1877|->         tab[i] = 0xff - (i * 255) / 16;
# 1878|       return tab;
# 1879|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def453]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeValTabSG6’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:2022:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:2020:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2020|       tab = (l_uint8 *)LEPT_CALLOC(37, sizeof(l_uint8));
# 2021|       for (i = 0; i < 37; i++)
# 2022|->         tab[i] = 0xff - (i * 255) / 36;
# 2023|       return tab;
# 2024|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def454]
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c: scope_hint: In function ‘makeValTabSG8’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:2114:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.85.0-build/leptonica-1.85.0/src/scale2.c:2112:22: note: in expansion of macro ‘LEPT_CALLOC’
# 2112|       tab = (l_uint8 *)LEPT_CALLOC(65, sizeof(l_uint8));
# 2113|       for (i = 0; i < 65; i++)
# 2114|->         tab[i] = 0xff - (i * 255) / 64;
# 2115|       return tab;
# 2116|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def455]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c: scope_hint: In function ‘seedfillGrayLow’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1144:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:51: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:172: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1110:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1110:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1136:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1138:37: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1143:44: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1143:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1142|                       if (boolval) {
# 1143|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1144|->                         pixel->x = i;
# 1145|                           pixel->y = j;
# 1146|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def456]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1178:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1176:56: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1177:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1176|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1177|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1178|->                         pixel->x = i - 1;
# 1179|                           pixel->y = j;
# 1180|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def457]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1190:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1185:28: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1188:53: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1189:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1188|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1189|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1190|->                         pixel->x = i;
# 1191|                           pixel->y = j - 1;
# 1192|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def458]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1201:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1199:56: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1200:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1199|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1200|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1201|->                         pixel->x = i + 1;
# 1202|                           pixel->y = j;
# 1203|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def459]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1212:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1211:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1210|                           SET_DATA_BYTE(lines, j + 1, L_MIN(val, maskval));
# 1211|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1212|->                         pixel->x = i;
# 1213|                           pixel->y = j + 1;
# 1214|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def460]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1323:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1267:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1267:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1315:32: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1317:37: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1322:44: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1322:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1321|                       if (boolval) {
# 1322|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1323|->                         pixel->x = i;
# 1324|                           pixel->y = j;
# 1325|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def461]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1359:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1357:43: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1358:48: note: in expansion of macro ‘LEPT_CALLOC’
# 1357|                                             L_MIN(val, maskval));
# 1358|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1359|->                             pixel->x = i - 1;
# 1360|                               pixel->y = j - 1;
# 1361|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def462]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1371:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1369:43: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1370:48: note: in expansion of macro ‘LEPT_CALLOC’
# 1369|                                             L_MIN(val, maskval));
# 1370|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1371|->                             pixel->x = i - 1;
# 1372|                               pixel->y = j + 1;
# 1373|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def463]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1381:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1379:56: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1380:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1379|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1380|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1381|->                         pixel->x = i - 1;
# 1382|                           pixel->y = j;
# 1383|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def464]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1393:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1388:28: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1391:53: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1392:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1391|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1392|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1393|->                         pixel->x = i;
# 1394|                           pixel->y = j - 1;
# 1395|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def465]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1406:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1404:43: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1405:48: note: in expansion of macro ‘LEPT_CALLOC’
# 1404|                                             L_MIN(val, maskval));
# 1405|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1406|->                             pixel->x = i + 1;
# 1407|                               pixel->y = j - 1;
# 1408|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def466]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1418:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:189:60: note: in definition of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1416:43: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1417:48: note: in expansion of macro ‘LEPT_CALLOC’
# 1416|                                             L_MIN(val, maskval));
# 1417|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1418|->                             pixel->x = i + 1;
# 1419|                               pixel->y = j + 1;
# 1420|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def467]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1428:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1426:56: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1427:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1426|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1427|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1428|->                         pixel->x = i + 1;
# 1429|                           pixel->y = j;
# 1430|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def468]
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1439:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1434:28: note: in expansion of macro ‘GET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/arrayaccess.h:199:75: note: in definition of macro ‘SET_DATA_BYTE’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1437:53: note: in expansion of macro ‘L_MIN’
leptonica-1.85.0-build/leptonica-1.85.0/src/seedfill.c:1438:44: note: in expansion of macro ‘LEPT_CALLOC’
# 1437|                           SET_DATA_BYTE(lines, j + 1, L_MIN(val, maskval));
# 1438|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1439|->                         pixel->x = i;
# 1440|                           pixel->y = j + 1;
# 1441|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def469]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selaCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:260:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sela’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:147: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:259:20: note: in expansion of macro ‘LEPT_CALLOC’
#  258|           /* Make array of sel ptrs */
#  259|       sela = (SELA *)LEPT_CALLOC(1, sizeof(SELA));
#  260|->     sela->nalloc = n;
#  261|       sela->n = 0;
#  262|       sela->sel = (SEL **)LEPT_CALLOC(n, sizeof(SEL *));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def470]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selCreate’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:316:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sel’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:314:18: note: in expansion of macro ‘LEPT_CALLOC’
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def471]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:317:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sel’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:314:18: note: in expansion of macro ‘LEPT_CALLOC’
#  315|       if (name)
#  316|           sel->name = stringNew(name);
#  317|->     sel->sy = height;
#  318|       sel->sx = width;
#  319|       if ((sel->data = create2dIntArray(height, width)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def472]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selCopy.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:375:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘csel’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:373:19: note: in expansion of macro ‘LEPT_CALLOC’
#  373|       csel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  374|       selGetParameters(sel, &sy, &sx, &cy, &cx);
#  375|->     csel->sy = sy;
#  376|       csel->sx = sx;
#  377|       csel->cy = cy;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def473]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:387:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)j * 4’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:516:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:31: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:31: note: in expansion of macro ‘LEPT_CALLOC’
#  385|       for (i = 0; i < sy; i++)
#  386|           for (j = 0; j < sx; j++)
#  387|->             csel->data[i][j] = sel->data[i][j];
#  388|   
#  389|       if (sel->name)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def474]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selCreateBrick.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:429:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)j * 4’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:516:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:31: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:31: note: in expansion of macro ‘LEPT_CALLOC’
#  427|       for (i = 0; i < h; i++)
#  428|           for (j = 0; j < w; j++)
#  429|->             sel->data[i][j] = type;
#  430|   
#  431|       return sel;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def475]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘create2dIntArray.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:516:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:516:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:518:31: note: in expansion of macro ‘LEPT_CALLOC’
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));
#  517|       for (i = 0; i < sy; i++)
#  518|->         array[i] = (l_int32 *)LEPT_CALLOC(sx, sizeof(l_int32));
#  519|       return array;
#  520|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def476]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selaAddSel’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:580:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*sela.sel + (long unsigned int)selaGetCount(sela) * 8’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:262:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:2051:23: note: in expansion of macro ‘ERROR_PTR’
#  578|       }
#  579|   
#  580|->     sela->sel[n] = csel;
#  581|       sela->n++;
#  582|       return 0;

Error: COMPILER_WARNING (CWE-563): [#def477]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c: scope_hint: In function ‘selReadStream’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:1354:41: warning[-Wunused-but-set-variable]: variable ‘ignore’ set but not used
# 1354 | l_int32  sy, sx, cy, cx, i, j, version, ignore;
#      |                                         ^~~~~~
# 1352|   char     selname[256];
# 1353|   char     linebuf[256];
# 1354|-> l_int32  sy, sx, cy, cx, i, j, version, ignore;
# 1355|   SEL     *sel;
# 1356|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def478]
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:1362:17: warning[-Wanalyzer-malloc-leak]: leak of ‘selReadStream(fp)’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:314:18: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:512:28: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/sel1.c:558:16: note: in expansion of macro ‘ERROR_INT’
# 1360|       if (fscanf(fp, "  Sel Version %d\n", &version) != 1)
# 1361|           return (SEL *)ERROR_PTR("not a sel file", __func__, NULL);
# 1362|->     if (version != SEL_VERSION_NUMBER)
# 1363|           return (SEL *)ERROR_PTR("invalid sel version", __func__, NULL);
# 1364|   

Error: CPPCHECK_WARNING (CWE-457): [#def479]
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c:766: warning[uninitvar]: Uninitialized variable: runlen
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def480]
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c: scope_hint: In function ‘pixGetRunsOnLine’
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c:766:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘runlen’
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: COMPILER_WARNING (CWE-457): [#def481]
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c: scope_hint: In function ‘pixGetRunsOnLine’
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c:766:5: warning[-Wmaybe-uninitialized]: ‘runlen’ may be used uninitialized
#  766 |     numaAddNumber(numa, runlen);  /* append last run */
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/selgen.c:714:14: note: ‘runlen’ was declared here
#  714 | l_int32   i, runlen, preval;
#      |              ^~~~~~
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def482]
leptonica-1.85.0-build/leptonica-1.85.0/src/spixio.c: scope_hint: In function ‘pixWriteStreamSpix’
leptonica-1.85.0-build/leptonica-1.85.0/src/spixio.c:278:5: warning[-Wanalyzer-null-argument]: use of NULL ‘data’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/spixio.c:64: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/spixio.c:371:20: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/spixio.c:279:5: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:31: included_from: Included from here.
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  276|       if (pixWriteMemSpix(&data, &size, pix))
#  277|           return ERROR_INT("failure to write pix to memory", __func__, 1);
#  278|->     fwrite(data, 1, size, fp);
#  279|       LEPT_FREE(data);
#  280|       return 0;

Error: CPPCHECK_WARNING (CWE-457): [#def483]
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c:177: warning[uninitvar]: Uninitialized variable: ratio
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def484]
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c: scope_hint: In function ‘pixFindStrokeWidth’
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c:177:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ratio’
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: COMPILER_WARNING (CWE-457): [#def485]
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c: scope_hint: In function ‘pixFindStrokeWidth’
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c:177:31: warning[-Wmaybe-uninitialized]: ‘ratio’ may be used uninitialized
#  177 |     width2 = 2.0f * (i - 1.0f + ratio + extra);
#      |                      ~~~~~~~~~^~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/strokes.c:133:29: note: ‘ratio’ was declared here
#  133 | l_float32   width1, width2, ratio, extra;
#      |                             ^~~~~
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def486]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c: scope_hint: In function ‘sudokuReadFile’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:235:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:145: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:221:24: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:221:24: note: in expansion of macro ‘LEPT_CALLOC’
#  233|                   error = TRUE;
#  234|               else
#  235|->                 array[index++] = val;
#  236|           }
#  237|           sarrayDestroy(&saline);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def487]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c: scope_hint: In function ‘sudokuCreate.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:313:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sud’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:312:23: note: in expansion of macro ‘LEPT_CALLOC’
#  311|       locs_index = 0;  /* into locs array */
#  312|       sud = (L_SUDOKU *)LEPT_CALLOC(1, sizeof(L_SUDOKU));
#  313|->     sud->locs = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  314|       sud->init = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  315|       sud->state = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def488]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:318:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:314:28: note: in expansion of macro ‘LEPT_CALLOC’
#  316|       for (i = 0; i < 81; i++) {
#  317|           val = array[i];
#  318|->         sud->init[i] = val;
#  319|           sud->state[i] = val;
#  320|           if (val == 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def489]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:319:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:315:29: note: in expansion of macro ‘LEPT_CALLOC’
#  317|           val = array[i];
#  318|           sud->init[i] = val;
#  319|->         sud->state[i] = val;
#  320|           if (val == 0)
#  321|               sud->locs[locs_index++] = i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def490]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:321:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:313:28: note: in expansion of macro ‘LEPT_CALLOC’
#  319|           sud->state[i] = val;
#  320|           if (val == 0)
#  321|->             sud->locs[locs_index++] = i;
#  322|       }
#  323|       sud->num = locs_index;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def491]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c: scope_hint: In function ‘sudokuRotateArray’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:670:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
#  668|                for (i = 8; i >= 0; i--) {
#  669|                    sindex = 9 * i + j;
#  670|->                  rarray[dindex++] = array[sindex];
#  671|                }
#  672|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def492]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:677:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
#  675|                for (j = 8; j >= 0; j--) {
#  676|                    sindex = 9 * i + j;
#  677|->                  rarray[dindex++] = array[sindex];
#  678|                }
#  679|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def493]
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:684:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/sudoku.c:665:25: note: in expansion of macro ‘LEPT_CALLOC’
#  682|                for (i = 0; i < 9; i++) {
#  683|                    sindex = 9 * i + j;
#  684|->                  rarray[dindex++] = array[sindex];
#  685|                }
#  686|           }

Error: COMPILER_WARNING (CWE-457): [#def494]
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c:1036:41: warning[-Wmaybe-uninitialized]: ‘allwhite’ may be used uninitialized
# 1036 |             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c: scope_hint: In function ‘splitStringToParagraphs’
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c:1016:21: note: ‘allwhite’ was declared here
# 1016 | l_int32  nlines, i, allwhite, leadwhite;
#      |                     ^~~~~~~~
# 1034|           if ((splitflag == SPLIT_ON_LEADING_WHITE && leadwhite) ||
# 1035|               (splitflag == SPLIT_ON_BLANK_LINE && allwhite) ||
# 1036|->             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
# 1037|               parastring = sarrayToString(satemp, 1);  /* add nl to each line */
# 1038|               sarrayAddString(saout, parastring, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def495]
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c:1036:54: warning[-Wmaybe-uninitialized]: ‘leadwhite’ may be used uninitialized
# 1036 |             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
#      |                                            ~~~~~~~~~~^~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c: scope_hint: In function ‘splitStringToParagraphs’
leptonica-1.85.0-build/leptonica-1.85.0/src/textops.c:1016:31: note: ‘leadwhite’ was declared here
# 1016 | l_int32  nlines, i, allwhite, leadwhite;
#      |                               ^~~~~~~~~
# 1034|           if ((splitflag == SPLIT_ON_LEADING_WHITE && leadwhite) ||
# 1035|               (splitflag == SPLIT_ON_BLANK_LINE && allwhite) ||
# 1036|->             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
# 1037|               parastring = sarrayToString(satemp, 1);  /* add nl to each line */
# 1038|               sarrayAddString(saout, parastring, L_INSERT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def496]
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c: scope_hint: In function ‘memstreamCreateForRead’
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c:2364:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mstream’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c:131: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c:2363:30: note: in expansion of macro ‘LEPT_CALLOC’
# 2362|   
# 2363|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2364|->     mstream->buffer = indata;   /* handle to input data array */
# 2365|       mstream->bufsize = insize;  /* amount of input data */
# 2366|       mstream->hw = insize;       /* high-water mark fixed at input data size */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def497]
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c: scope_hint: In function ‘memstreamCreateForWrite’
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c:2379:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mstream’
leptonica-1.85.0-build/leptonica-1.85.0/src/tiffio.c:2378:30: note: in expansion of macro ‘LEPT_CALLOC’
# 2377|   
# 2378|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2379|->     mstream->buffer = (l_uint8 *)LEPT_CALLOC(8 * 1024, 1);
# 2380|       mstream->bufsize = 8 * 1024;
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def498]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c: scope_hint: In function ‘fileCorruptByDeletion’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:577:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dataout’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:120: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:575:26: note: in expansion of macro ‘LEPT_CALLOC’
#  575|       dataout = (l_uint8 *)LEPT_CALLOC(outbytes, 1);
#  576|       for (i = 0; i < locb; i++)
#  577|->         dataout[i] = datain[i];
#  578|       for (i = 0; i < rembytes; i++)
#  579|           dataout[locb + i] = datain[locb + sizeb + i];

Error: GCC_ANALYZER_WARNING (CWE-121): [#def499]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c: scope_hint: In function ‘l_getFormattedDate’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:1452:5: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:1452:5: note: write of 14 bytes to beyond the end of ‘buf’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils1.c:1452:5: note: valid subscripts for ‘buf’ are ‘[0]’ to ‘[127]’
# 1450|   #endif
# 1451|       strftime(buf, sizeof(buf), "%Y%m%d%H%M%S", tptr);
# 1452|->     sprintf(buf + 14, "%c%02d'%02d'", sep, relh, relm);
# 1453|       return stringNew(buf);
# 1454|   }

Error: GCC_ANALYZER_WARNING (CWE-122): [#def500]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c: scope_hint: In function ‘stringCat’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:446:27: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:210: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2979:27: note: in expansion of macro ‘LEPT_CALLOC’
#  444|   
#  445|       for (i = 0; i < n; i++)
#  446|->         dest[lendest + i] = src[i];
#  447|       dest[lendest + n] = '\0';
#  448|       return n;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def501]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c: scope_hint: In function ‘splitPathAtDirectory.part.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2759:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:239:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:208: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
# 2757|       cpathname = stringNew(pathname);
# 2758|       convertSepCharsInPath(cpathname, UNIX_PATH_SEPCHAR);
# 2759|->     lastslash = strrchr(cpathname, '/');
# 2760|       if (lastslash) {
# 2761|           if (ptail)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def502]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2759:17: warning[-Wanalyzer-null-argument]: use of NULL ‘*pdir’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:239:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
# 2757|       cpathname = stringNew(pathname);
# 2758|       convertSepCharsInPath(cpathname, UNIX_PATH_SEPCHAR);
# 2759|->     lastslash = strrchr(cpathname, '/');
# 2760|       if (lastslash) {
# 2761|           if (ptail)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def503]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2759:17: warning[-Wanalyzer-null-argument]: use of NULL ‘tail’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:239:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3027:16: note: in expansion of macro ‘ERROR_INT’
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
# 2757|       cpathname = stringNew(pathname);
# 2758|       convertSepCharsInPath(cpathname, UNIX_PATH_SEPCHAR);
# 2759|->     lastslash = strrchr(cpathname, '/');
# 2760|       if (lastslash) {
# 2761|           if (ptail)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def504]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c: scope_hint: In function ‘makeTempDirname’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3224:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2904:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:597:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:233:9: note: in expansion of macro ‘L_WARNING’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:597:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:233:9: note: in expansion of macro ‘L_WARNING’
/usr/include/alloca.h:24: included_from: Included from here.
/usr/include/stdlib.h:706: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:32: included_from: Included from here.
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 3222|       path = stringNew(dir);
# 3223|   #endif  /*  ~ _WIN32 */
# 3224|->     pathlen = strlen(path);
# 3225|       if (pathlen < nbytes - 1) {
# 3226|           stringCopy(result, path, nbytes);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def505]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3368:11: warning[-Wanalyzer-null-argument]: use of NULL ‘basename’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:573:61: note: in definition of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:239:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2824:16: note: in expansion of macro ‘ERROR_INT’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 3366|       LEPT_FREE(tail);
# 3367|   
# 3368|->     len = strlen(basename);
# 3369|       if (numpre + numpost > len - 1) {
# 3370|           LEPT_FREE(basename);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def506]
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c: scope_hint: In function ‘extractNumberFromFilename’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3368:11: warning[-Wanalyzer-null-argument]: use of NULL ‘tail’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:239:24: note: in expansion of macro ‘ERROR_PTR’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2767:13: note: in expansion of macro ‘LEPT_FREE’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2824:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2824:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:576:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:2824:16: note: in expansion of macro ‘ERROR_INT’
leptonica-1.85.0-build/leptonica-1.85.0/src/utils2.c:3366:5: note: in expansion of macro ‘LEPT_FREE’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 3366|       LEPT_FREE(tail);
# 3367|   
# 3368|->     len = strlen(basename);
# 3369|       if (numpre + numpost > len - 1) {
# 3370|           LEPT_FREE(basename);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def507]
leptonica-1.85.0-build/leptonica-1.85.0/src/warper.c: scope_hint: In function ‘applyWarpTransform’
leptonica-1.85.0-build/leptonica-1.85.0/src/warper.c:278:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘randa’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/warper.c:70: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/environ.h:580:7: note: in expansion of macro ‘IF_SEV’
leptonica-1.85.0-build/leptonica-1.85.0/src/warper.c:243:29: note: in expansion of macro ‘ERROR_PTR’
#  276|           anglex = xfreq * randa[3 * i + 1] * xp + twopi * randa[3 * i + 2];
#  277|           angley = yfreq * randa[3 * i + 3] * yp + twopi * randa[3 * i + 4];
#  278|->         x += xmag * randa[3 * i] * sin(anglex) * sin(angley);
#  279|       }
#  280|       for (i = nx, y = yp; i < nx + ny; i++) {

Error: COMPILER_WARNING (CWE-457): [#def508]
leptonica-1.85.0-build/leptonica-1.85.0/src/watershed.c:412:21: warning[-Wmaybe-uninitialized]: ‘index’ may be used uninitialized
#  412 |         cindex = lut[index];
#      |                     ^
leptonica-1.85.0-build/leptonica-1.85.0/src/watershed.c:317:34: note: ‘index’ was declared here
#  317 | l_int32   i, j, val, x, y, w, h, index, mindepth;
#      |                                  ^~~~~
#  410|           else
#  411|               clabel = lut[ulabel];
#  412|->         cindex = lut[index];
#  413|           if (clabel == cindex) continue;  /* have already seen this one */
#  414|           if (clabel == MAX_LABEL_VALUE) {  /* new one; assign index and try to

Error: COMPILER_WARNING (CWE-457): [#def509]
leptonica-1.85.0-build/leptonica-1.85.0/src/watershed.c: scope_hint: In function ‘wshedApply’
leptonica-1.85.0-build/leptonica-1.85.0/src/watershed.c:490:17: warning[-Wmaybe-uninitialized]: ‘val’ may be used uninitialized
#  490 |                 wshedSaveBasin(wshed, cindex, val - 1);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/watershed.c:317:17: note: ‘val’ was declared here
#  317 | l_int32   i, j, val, x, y, w, h, index, mindepth;
#      |                 ^~~
#  488|                   debugWshedMerge(wshed, one_new_watershed_index,
#  489|                                   x, y, clabel, cindex);
#  490|->                 wshedSaveBasin(wshed, cindex, val - 1);
#  491|                   numaSetValue(nasi, cindex, 0);
#  492|                   mergeLookup(wshed, cindex, clabel);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def510]
leptonica-1.85.0-build/leptonica-1.85.0/src/webpio.c: scope_hint: In function ‘pixWriteStreamWebP’
leptonica-1.85.0-build/leptonica-1.85.0/src/webpio.c:305:14: warning[-Wanalyzer-null-argument]: use of NULL ‘filedata’ where non-null expected
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:31: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/webpio.c:50: included_from: Included from here.
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  303|       pixWriteMemWebP(&filedata, &filebytes, pixs, quality, lossless);
#  304|       rewind(fp);
#  305|->     nbytes = fwrite(filedata, 1, filebytes, fp);
#  306|       free(filedata);
#  307|       if (nbytes != filebytes)

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-118.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameleptonica-1.85.0-1.fc42
store-results-to/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.tar.xz
time-created2024-11-13 01:26:26
time-finished2024-11-13 01:38:09
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9