openjpeg2-2.5.2-1.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
openjpeg2-2.5.2-build/openjpeg-2.5.2/redhat-linux-build/CMakeFiles/TestLargeFiles.c: scope_hint: In function ‘main’
openjpeg2-2.5.2-build/openjpeg-2.5.2/redhat-linux-build/CMakeFiles/TestLargeFiles.c:17:18: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(*argv, "r")’ where non-null expected
openjpeg2-2.5.2-build/openjpeg-2.5.2/redhat-linux-build/CMakeFiles/TestLargeFiles.c:6: included_from: Included from here.
/usr/include/stdio.h:799:16: note: argument 1 of ‘ftello’ must be non-null
#   15|     int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
#   16|     FILE *fp = fopen(argv[0],"r");
#   17|->   off_t offset = ftello( fp );
#   18|   
#   19|     fseeko( fp, offset, SEEK_CUR );

Error: CPPCHECK_WARNING: [#def2]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/common/color.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/common/opj_getopt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/common/opj_getopt.c: scope_hint: In function ‘opj_getopt’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/common/opj_getopt.c:103:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘oli’
#  101|           }
#  102|       }
#  103|->     if (*++oli != ':') {      /* don't need argument */
#  104|           opj_optarg = NULL;
#  105|           if (!*place) {

Error: CLANG_WARNING: [#def5]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/common/opj_getopt.c:103:9: warning[core.NullDereference]: Dereference of null pointer
#  101|           }
#  102|       }
#  103|->     if (*++oli != ':') {      /* don't need argument */
#  104|           opj_optarg = NULL;
#  105|           if (!*place) {

Error: CPPCHECK_WARNING: [#def6]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-122): [#def7]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c: scope_hint: In function ‘imagetopgx’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:1383:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
# 1381|               }
# 1382|           }
# 1383|->         memcpy(name, outfile, dotpos);
# 1384|           sprintf(name + dotpos, "_%u.pgx", compno);
# 1385|           fdest = fopen(name, "wb");

Error: GCC_ANALYZER_WARNING (CWE-122): [#def8]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:1384:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
# 1382|           }
# 1383|           memcpy(name, outfile, dotpos);
# 1384|->         sprintf(name + dotpos, "_%u.pgx", compno);
# 1385|           fdest = fopen(name, "wb");
# 1386|           /* don't need name anymore */

Error: CLANG_WARNING: [#def9]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:1788:9: warning[deadcode.DeadStores]: Value stored to 'subsampling_dx' during its initialization is never read
# 1786|   opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters)
# 1787|   {
# 1788|->     int subsampling_dx = parameters->subsampling_dx;
# 1789|       int subsampling_dy = parameters->subsampling_dy;
# 1790|   

Error: CLANG_WARNING: [#def10]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:1789:9: warning[deadcode.DeadStores]: Value stored to 'subsampling_dy' during its initialization is never read
# 1787|   {
# 1788|       int subsampling_dx = parameters->subsampling_dx;
# 1789|->     int subsampling_dy = parameters->subsampling_dy;
# 1790|   
# 1791|       FILE *fp = NULL;

Error: CLANG_WARNING: [#def11]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:2034:5: warning[deadcode.DeadStores]: Value stored to 'two' is never read
# 2032|           return 1;
# 2033|       }
# 2034|->     two = has_alpha = 0;
# 2035|       fails = 1;
# 2036|       ncomp = image->numcomps;

Error: CLANG_WARNING: [#def12]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convert.c:2036:5: warning[deadcode.DeadStores]: Value stored to 'ncomp' is never read
# 2034|       two = has_alpha = 0;
# 2035|       fails = 1;
# 2036|->     ncomp = image->numcomps;
# 2037|   
# 2038|       while (*tmp) {

Error: CPPCHECK_WARNING: [#def13]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertbmp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c: scope_hint: In function ‘pngtoimage’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:281:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
/usr/include/libpng16/pngconf.h:51: included_from: Included from here.
/usr/include/libpng16/png.h:335: included_from: Included from here.
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:47: included_from: Included from here.
#  279|                   free(rows[i]);
#  280|               }
#  281|->         free(rows);
#  282|       }
#  283|       if (row32s) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c: scope_hint: In function ‘imagetopng’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:396:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(write_idf, "wb")’
#  394|       writer = fopen(write_idf, "wb");
#  395|   
#  396|->     if (writer == NULL) {
#  397|           return fails;
#  398|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:396:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(write_idf, "wb")’
#  394|       writer = fopen(write_idf, "wb");
#  395|   
#  396|->     if (writer == NULL) {
#  397|           return fails;
#  398|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:485:21: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(png_get_rowbytes(png,  info))’
#  483|           }
#  484|           row_buf = (png_bytep)malloc(png_row_size);
#  485|->         if (row_buf == NULL) {
#  486|               fprintf(stderr, "Can't allocate memory for PNG row\n");
#  487|               goto fin;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:491:23: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)*image_176(D)->comps.w * (long unsigned int)nr_comp * 4)’
#  489|           buffer32s = (OPJ_INT32*)malloc((OPJ_SIZE_T)image->comps[0].w *
#  490|                                          (OPJ_SIZE_T)nr_comp * sizeof(OPJ_INT32));
#  491|->         if (buffer32s == NULL) {
#  492|               fprintf(stderr, "Can't allocate memory for interleaved 32s row\n");
#  493|               goto fin;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def20]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/convertpng.c:524:13: warning[-Wanalyzer-jump-through-null]: jump through null pointer
#  522|           for (y = 0; y < image->comps[0].h; ++y) {
#  523|               cvtPxToCx(planes, buffer32s_cpy, width, adjust);
#  524|->             cvt32sToPack(buffer32s_cpy, row_buf_cpy, width * (OPJ_SIZE_T)nr_comp);
#  525|               png_write_row(png, row_buf_cpy);
#  526|               planes[0] += width;

Error: CPPCHECK_WARNING: [#def21]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-190): [#def22]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:957: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  955|   
#  956|           if (length > 1U) {
#  957|->             GETBITS(pDst[i + 1], 9)
#  958|               if (length > 2U) {
#  959|                   GETBITS(pDst[i + 2], 9)

Error: CPPCHECK_WARNING (CWE-758): [#def23]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:957: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  955|   
#  956|           if (length > 1U) {
#  957|->             GETBITS(pDst[i + 1], 9)
#  958|               if (length > 2U) {
#  959|                   GETBITS(pDst[i + 2], 9)

Error: CPPCHECK_WARNING (CWE-190): [#def24]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:959: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  957|               GETBITS(pDst[i + 1], 9)
#  958|               if (length > 2U) {
#  959|->                 GETBITS(pDst[i + 2], 9)
#  960|                   if (length > 3U) {
#  961|                       GETBITS(pDst[i + 3], 9)

Error: CPPCHECK_WARNING (CWE-758): [#def25]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:959: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  957|               GETBITS(pDst[i + 1], 9)
#  958|               if (length > 2U) {
#  959|->                 GETBITS(pDst[i + 2], 9)
#  960|                   if (length > 3U) {
#  961|                       GETBITS(pDst[i + 3], 9)

Error: CPPCHECK_WARNING (CWE-190): [#def26]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:961: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  959|                   GETBITS(pDst[i + 2], 9)
#  960|                   if (length > 3U) {
#  961|->                     GETBITS(pDst[i + 3], 9)
#  962|                       if (length > 4U) {
#  963|                           GETBITS(pDst[i + 4], 9)

Error: CPPCHECK_WARNING (CWE-758): [#def27]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:961: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  959|                   GETBITS(pDst[i + 2], 9)
#  960|                   if (length > 3U) {
#  961|->                     GETBITS(pDst[i + 3], 9)
#  962|                       if (length > 4U) {
#  963|                           GETBITS(pDst[i + 4], 9)

Error: CPPCHECK_WARNING (CWE-190): [#def28]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:963: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  961|                       GETBITS(pDst[i + 3], 9)
#  962|                       if (length > 4U) {
#  963|->                         GETBITS(pDst[i + 4], 9)
#  964|                           if (length > 5U) {
#  965|                               GETBITS(pDst[i + 5], 9)

Error: CPPCHECK_WARNING (CWE-758): [#def29]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:963: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  961|                       GETBITS(pDst[i + 3], 9)
#  962|                       if (length > 4U) {
#  963|->                         GETBITS(pDst[i + 4], 9)
#  964|                           if (length > 5U) {
#  965|                               GETBITS(pDst[i + 5], 9)

Error: CPPCHECK_WARNING (CWE-190): [#def30]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:965: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  963|                           GETBITS(pDst[i + 4], 9)
#  964|                           if (length > 5U) {
#  965|->                             GETBITS(pDst[i + 5], 9)
#  966|                               if (length > 6U) {
#  967|                                   GETBITS(pDst[i + 6], 9)

Error: CPPCHECK_WARNING (CWE-758): [#def31]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:965: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  963|                           GETBITS(pDst[i + 4], 9)
#  964|                           if (length > 5U) {
#  965|->                             GETBITS(pDst[i + 5], 9)
#  966|                               if (length > 6U) {
#  967|                                   GETBITS(pDst[i + 6], 9)

Error: CPPCHECK_WARNING (CWE-190): [#def32]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:967: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
#  965|                               GETBITS(pDst[i + 5], 9)
#  966|                               if (length > 6U) {
#  967|->                                 GETBITS(pDst[i + 6], 9)
#  968|                               }
#  969|                           }

Error: CPPCHECK_WARNING (CWE-758): [#def33]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:967: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  965|                               GETBITS(pDst[i + 5], 9)
#  966|                               if (length > 6U) {
#  967|->                                 GETBITS(pDst[i + 6], 9)
#  968|                               }
#  969|                           }

Error: CPPCHECK_WARNING (CWE-190): [#def34]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1045: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1043|   
# 1044|           if (length > 1U) {
# 1045|->             GETBITS(pDst[i + 1], 11)
# 1046|               if (length > 2U) {
# 1047|                   GETBITS(pDst[i + 2], 11)

Error: CPPCHECK_WARNING (CWE-758): [#def35]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1045: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1043|   
# 1044|           if (length > 1U) {
# 1045|->             GETBITS(pDst[i + 1], 11)
# 1046|               if (length > 2U) {
# 1047|                   GETBITS(pDst[i + 2], 11)

Error: CPPCHECK_WARNING (CWE-190): [#def36]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1047: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1045|               GETBITS(pDst[i + 1], 11)
# 1046|               if (length > 2U) {
# 1047|->                 GETBITS(pDst[i + 2], 11)
# 1048|                   if (length > 3U) {
# 1049|                       GETBITS(pDst[i + 3], 11)

Error: CPPCHECK_WARNING (CWE-758): [#def37]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1047: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1045|               GETBITS(pDst[i + 1], 11)
# 1046|               if (length > 2U) {
# 1047|->                 GETBITS(pDst[i + 2], 11)
# 1048|                   if (length > 3U) {
# 1049|                       GETBITS(pDst[i + 3], 11)

Error: CPPCHECK_WARNING (CWE-190): [#def38]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1049: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1047|                   GETBITS(pDst[i + 2], 11)
# 1048|                   if (length > 3U) {
# 1049|->                     GETBITS(pDst[i + 3], 11)
# 1050|                       if (length > 4U) {
# 1051|                           GETBITS(pDst[i + 4], 11)

Error: CPPCHECK_WARNING (CWE-758): [#def39]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1049: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1047|                   GETBITS(pDst[i + 2], 11)
# 1048|                   if (length > 3U) {
# 1049|->                     GETBITS(pDst[i + 3], 11)
# 1050|                       if (length > 4U) {
# 1051|                           GETBITS(pDst[i + 4], 11)

Error: CPPCHECK_WARNING (CWE-190): [#def40]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1051: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1049|                       GETBITS(pDst[i + 3], 11)
# 1050|                       if (length > 4U) {
# 1051|->                         GETBITS(pDst[i + 4], 11)
# 1052|                           if (length > 5U) {
# 1053|                               GETBITS(pDst[i + 5], 11)

Error: CPPCHECK_WARNING (CWE-758): [#def41]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1051: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1049|                       GETBITS(pDst[i + 3], 11)
# 1050|                       if (length > 4U) {
# 1051|->                         GETBITS(pDst[i + 4], 11)
# 1052|                           if (length > 5U) {
# 1053|                               GETBITS(pDst[i + 5], 11)

Error: CPPCHECK_WARNING (CWE-190): [#def42]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1053: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1051|                           GETBITS(pDst[i + 4], 11)
# 1052|                           if (length > 5U) {
# 1053|->                             GETBITS(pDst[i + 5], 11)
# 1054|                               if (length > 6U) {
# 1055|                                   GETBITS(pDst[i + 6], 11)

Error: CPPCHECK_WARNING (CWE-758): [#def43]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1053: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1051|                           GETBITS(pDst[i + 4], 11)
# 1052|                           if (length > 5U) {
# 1053|->                             GETBITS(pDst[i + 5], 11)
# 1054|                               if (length > 6U) {
# 1055|                                   GETBITS(pDst[i + 6], 11)

Error: CPPCHECK_WARNING (CWE-190): [#def44]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1055: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1053|                               GETBITS(pDst[i + 5], 11)
# 1054|                               if (length > 6U) {
# 1055|->                                 GETBITS(pDst[i + 6], 11)
# 1056|                               }
# 1057|                           }

Error: CPPCHECK_WARNING (CWE-758): [#def45]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1055: error[shiftTooManyBits]: Shifting 32-bit value by 4294967293 bits is undefined behaviour
# 1053|                               GETBITS(pDst[i + 5], 11)
# 1054|                               if (length > 6U) {
# 1055|->                                 GETBITS(pDst[i + 6], 11)
# 1056|                               }
# 1057|                           }

Error: CPPCHECK_WARNING (CWE-190): [#def46]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1120: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1118|   
# 1119|           if (length > 1U) {
# 1120|->             GETBITS(pDst[i + 1], 13)
# 1121|               if (length > 2U) {
# 1122|                   GETBITS(pDst[i + 2], 13)

Error: CPPCHECK_WARNING (CWE-758): [#def47]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1120: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1118|   
# 1119|           if (length > 1U) {
# 1120|->             GETBITS(pDst[i + 1], 13)
# 1121|               if (length > 2U) {
# 1122|                   GETBITS(pDst[i + 2], 13)

Error: CPPCHECK_WARNING (CWE-190): [#def48]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1122: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1120|               GETBITS(pDst[i + 1], 13)
# 1121|               if (length > 2U) {
# 1122|->                 GETBITS(pDst[i + 2], 13)
# 1123|                   if (length > 3U) {
# 1124|                       GETBITS(pDst[i + 3], 13)

Error: CPPCHECK_WARNING (CWE-758): [#def49]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1122: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1120|               GETBITS(pDst[i + 1], 13)
# 1121|               if (length > 2U) {
# 1122|->                 GETBITS(pDst[i + 2], 13)
# 1123|                   if (length > 3U) {
# 1124|                       GETBITS(pDst[i + 3], 13)

Error: CPPCHECK_WARNING (CWE-190): [#def50]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1124: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1122|                   GETBITS(pDst[i + 2], 13)
# 1123|                   if (length > 3U) {
# 1124|->                     GETBITS(pDst[i + 3], 13)
# 1125|                       if (length > 4U) {
# 1126|                           GETBITS(pDst[i + 4], 13)

Error: CPPCHECK_WARNING (CWE-758): [#def51]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1124: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1122|                   GETBITS(pDst[i + 2], 13)
# 1123|                   if (length > 3U) {
# 1124|->                     GETBITS(pDst[i + 3], 13)
# 1125|                       if (length > 4U) {
# 1126|                           GETBITS(pDst[i + 4], 13)

Error: CPPCHECK_WARNING (CWE-190): [#def52]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1126: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1124|                       GETBITS(pDst[i + 3], 13)
# 1125|                       if (length > 4U) {
# 1126|->                         GETBITS(pDst[i + 4], 13)
# 1127|                           if (length > 5U) {
# 1128|                               GETBITS(pDst[i + 5], 13)

Error: CPPCHECK_WARNING (CWE-758): [#def53]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1126: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1124|                       GETBITS(pDst[i + 3], 13)
# 1125|                       if (length > 4U) {
# 1126|->                         GETBITS(pDst[i + 4], 13)
# 1127|                           if (length > 5U) {
# 1128|                               GETBITS(pDst[i + 5], 13)

Error: CPPCHECK_WARNING (CWE-190): [#def54]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1128: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1126|                           GETBITS(pDst[i + 4], 13)
# 1127|                           if (length > 5U) {
# 1128|->                             GETBITS(pDst[i + 5], 13)
# 1129|                               if (length > 6U) {
# 1130|                                   GETBITS(pDst[i + 6], 13)

Error: CPPCHECK_WARNING (CWE-758): [#def55]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1128: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1126|                           GETBITS(pDst[i + 4], 13)
# 1127|                           if (length > 5U) {
# 1128|->                             GETBITS(pDst[i + 5], 13)
# 1129|                               if (length > 6U) {
# 1130|                                   GETBITS(pDst[i + 6], 13)

Error: CPPCHECK_WARNING (CWE-190): [#def56]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1130: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1128|                               GETBITS(pDst[i + 5], 13)
# 1129|                               if (length > 6U) {
# 1130|->                                 GETBITS(pDst[i + 6], 13)
# 1131|                               }
# 1132|                           }

Error: CPPCHECK_WARNING (CWE-758): [#def57]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1130: error[shiftTooManyBits]: Shifting 32-bit value by 4294967291 bits is undefined behaviour
# 1128|                               GETBITS(pDst[i + 5], 13)
# 1129|                               if (length > 6U) {
# 1130|->                                 GETBITS(pDst[i + 6], 13)
# 1131|                               }
# 1132|                           }

Error: CPPCHECK_WARNING (CWE-190): [#def58]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1216: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1214|   
# 1215|           if (length > 1U) {
# 1216|->             GETBITS(pDst[i + 1], 15)
# 1217|               if (length > 2U) {
# 1218|                   GETBITS(pDst[i + 2], 15)

Error: CPPCHECK_WARNING (CWE-758): [#def59]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1216: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1214|   
# 1215|           if (length > 1U) {
# 1216|->             GETBITS(pDst[i + 1], 15)
# 1217|               if (length > 2U) {
# 1218|                   GETBITS(pDst[i + 2], 15)

Error: CPPCHECK_WARNING (CWE-190): [#def60]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1218: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1216|               GETBITS(pDst[i + 1], 15)
# 1217|               if (length > 2U) {
# 1218|->                 GETBITS(pDst[i + 2], 15)
# 1219|                   if (length > 3U) {
# 1220|                       GETBITS(pDst[i + 3], 15)

Error: CPPCHECK_WARNING (CWE-758): [#def61]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1218: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1216|               GETBITS(pDst[i + 1], 15)
# 1217|               if (length > 2U) {
# 1218|->                 GETBITS(pDst[i + 2], 15)
# 1219|                   if (length > 3U) {
# 1220|                       GETBITS(pDst[i + 3], 15)

Error: CPPCHECK_WARNING (CWE-190): [#def62]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1220: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1218|                   GETBITS(pDst[i + 2], 15)
# 1219|                   if (length > 3U) {
# 1220|->                     GETBITS(pDst[i + 3], 15)
# 1221|                       if (length > 4U) {
# 1222|                           GETBITS(pDst[i + 4], 15)

Error: CPPCHECK_WARNING (CWE-758): [#def63]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1220: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1218|                   GETBITS(pDst[i + 2], 15)
# 1219|                   if (length > 3U) {
# 1220|->                     GETBITS(pDst[i + 3], 15)
# 1221|                       if (length > 4U) {
# 1222|                           GETBITS(pDst[i + 4], 15)

Error: CPPCHECK_WARNING (CWE-190): [#def64]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1222: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1220|                       GETBITS(pDst[i + 3], 15)
# 1221|                       if (length > 4U) {
# 1222|->                         GETBITS(pDst[i + 4], 15)
# 1223|                           if (length > 5U) {
# 1224|                               GETBITS(pDst[i + 5], 15)

Error: CPPCHECK_WARNING (CWE-758): [#def65]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1222: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1220|                       GETBITS(pDst[i + 3], 15)
# 1221|                       if (length > 4U) {
# 1222|->                         GETBITS(pDst[i + 4], 15)
# 1223|                           if (length > 5U) {
# 1224|                               GETBITS(pDst[i + 5], 15)

Error: CPPCHECK_WARNING (CWE-190): [#def66]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1224: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1222|                           GETBITS(pDst[i + 4], 15)
# 1223|                           if (length > 5U) {
# 1224|->                             GETBITS(pDst[i + 5], 15)
# 1225|                               if (length > 6U) {
# 1226|                                   GETBITS(pDst[i + 6], 15)

Error: CPPCHECK_WARNING (CWE-758): [#def67]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1224: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1222|                           GETBITS(pDst[i + 4], 15)
# 1223|                           if (length > 5U) {
# 1224|->                             GETBITS(pDst[i + 5], 15)
# 1225|                               if (length > 6U) {
# 1226|                                   GETBITS(pDst[i + 6], 15)

Error: CPPCHECK_WARNING (CWE-190): [#def68]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1226: error[integerOverflow]: Signed integer overflow for expression 'available-needed'.
# 1224|                               GETBITS(pDst[i + 5], 15)
# 1225|                               if (length > 6U) {
# 1226|->                                 GETBITS(pDst[i + 6], 15)
# 1227|                               }
# 1228|                           }

Error: CPPCHECK_WARNING (CWE-758): [#def69]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/converttif.c:1226: error[shiftTooManyBits]: Shifting 32-bit value by 4294967289 bits is undefined behaviour
# 1224|                               GETBITS(pDst[i + 5], 15)
# 1225|                               if (length > 6U) {
# 1226|->                                 GETBITS(pDst[i + 6], 15)
# 1227|                               }
# 1228|                           }

Error: CPPCHECK_WARNING: [#def70]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/index.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def71]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def72]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c:524:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  522|           }
#  523|   
#  524|->         strcpy(dirptr->filename[i], content->d_name);
#  525|           i++;
#  526|       }

Error: CLANG_WARNING: [#def73]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c:524:16: warning[core.NullDereference]: Access to field 'filename' results in a dereference of a null pointer (loaded from variable 'dirptr')
#  522|           }
#  523|   
#  524|->         strcpy(dirptr->filename[i], content->d_name);
#  525|           i++;
#  526|       }

Error: CLANG_WARNING: [#def74]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c:567:28: warning[core.NullDereference]: Access to field 'filename' results in a dereference of a null pointer (loaded from variable 'dirptr')
#  565|       char *temp_p, temp1[OPJ_PATH_LEN] = "";
#  566|   
#  567|->     strcpy(image_filename, dirptr->filename[imageno]);
#  568|       fprintf(stderr, "File Number %u \"%s\"\n", imageno, image_filename);
#  569|       parameters->decod_format = get_file_format(image_filename);

Error: GCC_ANALYZER_WARNING: [#def75]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c: scope_hint: In function ‘parse_cmdline_encoder’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c:1363:32: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_compress.c:1363:32: note: only use operands of an integer type inside the size argument
# 1361|               lMctComp = lNbComp * lNbComp;
# 1362|               lTotalComp = lMctComp + lNbComp;
# 1363|->             lSpace = (float *) malloc((size_t)lTotalComp * sizeof(float));
# 1364|               if (lSpace == NULL) {
# 1365|                   free(lMatrix);

Error: CPPCHECK_WARNING: [#def76]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_decompress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def77]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_decompress.c:430:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  428|           }
#  429|   
#  430|->         strcpy(dirptr->filename[i], content->d_name);
#  431|           i++;
#  432|       }

Error: CLANG_WARNING: [#def78]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_decompress.c:766:13: warning[unix.Malloc]: Potential memory leak
#  764|                   return 1;
#  765|               }
#  766|->             strcpy(img_fol->imgdirpath, opj_optarg);
#  767|               img_fol->set_imgdir = 1;
#  768|           }

Error: CPPCHECK_WARNING: [#def79]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_dump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_dump.c: scope_hint: In function ‘parse_cmdline_decoder’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_dump.c:402:33: warning[-Wanalyzer-malloc-leak]: leak of ‘img_fol.imgdirpath’
#  400|   
#  401|           case 'y': {         /* Image Directory path */
#  402|->             img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
#  403|               if (img_fol->imgdirpath == NULL) {
#  404|                   return 1;

Error: CLANG_WARNING: [#def81]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/bin/jp2/opj_dump.c:406:13: warning[unix.Malloc]: Potential memory leak
#  404|                   return 1;
#  405|               }
#  406|->             strcpy(img_fol->imgdirpath, opj_optarg);
#  407|               img_fol->set_imgdir = 1;
#  408|           }

Error: CPPCHECK_WARNING: [#def82]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/dwt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def83]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/dwt.c:2242:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 2240|   {
# 2241|       OPJ_BOOL ret;
# 2242|->     ret = opj_sparse_array_int32_read(sa,
# 2243|                                         win_l_x0, sa_line,
# 2244|                                         win_l_x1, sa_line + 1,

Error: CLANG_WARNING: [#def84]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/dwt.c:2270:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 2268|   {
# 2269|       OPJ_BOOL ret;
# 2270|->     ret  = opj_sparse_array_int32_read(sa,
# 2271|                                          sa_col, win_l_y0,
# 2272|                                          sa_col + nb_cols, win_l_y1,

Error: CLANG_WARNING: [#def85]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/dwt.c:2959:9: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 2957|       for (i = 0; i < remaining_height; i++) {
# 2958|           OPJ_BOOL ret;
# 2959|->         ret = opj_sparse_array_int32_read(sa,
# 2960|                                             dwt->win_l_x0, sa_line + i,
# 2961|                                             dwt->win_l_x1, sa_line + i + 1,

Error: CLANG_WARNING: [#def86]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/dwt.c:3005:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 3003|   {
# 3004|       OPJ_BOOL ret;
# 3005|->     ret = opj_sparse_array_int32_read(sa,
# 3006|                                         sa_col, dwt->win_l_x0,
# 3007|                                         sa_col + nb_elts_read, dwt->win_l_x1,

Error: CPPCHECK_WARNING: [#def87]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def88]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:922:5: warning[deadcode.DeadStores]: Value stored to 'val' is never read
#  920|       assert(msp->bits <= 32); // assert that there is a space for 32 bits
#  921|   
#  922|->     val = 0u;
#  923|       if (msp->size > 3) {
#  924|           val = read_le_uint32(msp->data);  // read 32 bits

Error: CLANG_WARNING: [#def89]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1578:20: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>' is a garbage value
# 1576|           //decode uvlc_mode to get u for both quads
# 1577|           consumed_bits = decode_init_uvlc(vlc_val, uvlc_mode, U_q);
# 1578|->         if (U_q[0] > zero_bplanes_p1 || U_q[1] > zero_bplanes_p1) {
# 1579|               if (p_manager_mutex) {
# 1580|                   opj_mutex_lock(p_manager_mutex);

Error: CLANG_WARNING: [#def90]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1592:9: warning[deadcode.DeadStores]: Value stored to 'vlc_val' is never read
# 1590|   
# 1591|           //consume u bits in the VLC code
# 1592|->         vlc_val = rev_advance(&vlc, consumed_bits);
# 1593|   
# 1594|           //decode magsgn and update line_state

Error: CLANG_WARNING: [#def91]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1672:19: warning[core.NullDereference]: Array access (from variable 'sp') results in a null pointer dereference
# 1670|               v_n |= (((qinf[0] & 0x400) >> 10) << m_n);
# 1671|               v_n |= 1;
# 1672|->             sp[0] = val | ((v_n + 2) << (p - 1));
# 1673|           } else if (locs & 0x4) {
# 1674|               sp[0] = 0;

Error: CLANG_WARNING: [#def92]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1674:19: warning[core.NullDereference]: Array access (from variable 'sp') results in a null pointer dereference
# 1672|               sp[0] = val | ((v_n + 2) << (p - 1));
# 1673|           } else if (locs & 0x4) {
# 1674|->             sp[0] = 0;
# 1675|           }
# 1676|   

Error: CLANG_WARNING: [#def93]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1687:24: warning[core.NullDereference]: Array access (from variable 'sp') results in a null pointer dereference
# 1685|               v_n |= ((qinf[0] & 0x800) >> 11) << m_n;
# 1686|               v_n |= 1; //center of bin
# 1687|->             sp[stride] = val | ((v_n + 2) << (p - 1));
# 1688|   
# 1689|               //line_state: bit 7 (\sigma^NW), and E^NW for next quad

Error: CLANG_WARNING: [#def94]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1692:24: warning[core.NullDereference]: Array access (from variable 'sp') results in a null pointer dereference
# 1690|               lsp[0] = (OPJ_UINT8)(0x80 | (32 - count_leading_zeros(v_n)));
# 1691|           } else if (locs & 0x8) { //if outside set to 0
# 1692|->             sp[stride] = 0;
# 1693|           }
# 1694|   

Error: CLANG_WARNING: [#def95]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/ht_dec.c:1710:19: warning[core.NullDereference]: Array access (from variable 'sp') results in a null pointer dereference
# 1708|               sp[0] = val | ((v_n + 2) << (p - 1));
# 1709|           } else if (locs & 0x10) {
# 1710|->             sp[0] = 0;
# 1711|           }
# 1712|   

Error: CPPCHECK_WARNING: [#def96]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/invert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def97]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def98]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c: scope_hint: In function ‘opj_j2k_write_plt_in_memory’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c:4722:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘marker_info’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/opj_includes.h:228: included_from: Included from here.
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c:44: included_from: Included from here.
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c:4807:5: note: in expansion of macro ‘opj_write_bytes’
# 4720|       Lplt = 3;
# 4721|   
# 4722|->     for (i = 0; i < marker_info->packet_count; i++) {
# 4723|           OPJ_BYTE var_bytes[5];
# 4724|           OPJ_UINT8 var_bytes_size = 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def99]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c: scope_hint: In function ‘opj_j2k_decode_tiles’
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/j2k.c:11701:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘l_current_tile_no’
#11699|           }
#11700|   
#11701|->         if (! opj_j2k_decode_tile(p_j2k, l_current_tile_no, NULL, 0,
#11702|                                     p_stream, p_manager)) {
#11703|               opj_event_msg(p_manager, EVT_ERROR, "Failed to decode tile 1/1\n");

Error: CPPCHECK_WARNING: [#def100]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/jp2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def101]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/jp2.c:1488:9: warning[deadcode.DeadStores]: Value stored to 'p_colr_header_data' is never read
# 1486|           opj_event_msg(p_manager, EVT_INFO,
# 1487|                         "A conforming JP2 reader shall ignore all Colour Specification boxes after the first, so we ignore this one.\n");
# 1488|->         p_colr_header_data += p_colr_header_size;
# 1489|           return OPJ_TRUE;
# 1490|       }

Error: CLANG_WARNING: [#def102]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/jp2.c:1548:17: warning[deadcode.DeadStores]: Value stored to 'p_colr_header_data' is never read
# 1546|                   p_colr_header_data += 4;
# 1547|                   opj_read_bytes(p_colr_header_data, &il, 4);
# 1548|->                 p_colr_header_data += 4;
# 1549|   
# 1550|                   cielab[1] = 0;

Error: CLANG_WARNING: [#def103]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/jp2.c:1972:9: warning[deadcode.DeadStores]: Value stored to 'sign' is never read
# 1970|       for (i = 1; i < image->numcomps; i++) {
# 1971|           OPJ_UINT32 depth = image->comps[i].prec - 1;
# 1972|->         sign = image->comps[i].sgnd;
# 1973|           if (depth_0 != depth) {
# 1974|               jp2->bpc = 255;

Error: CPPCHECK_WARNING: [#def104]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/mct.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def105]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/pi.c:41: included_from: Included from here.
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/opj_includes.h:248: included_from: Included from here.
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/opj_intmath.h:229:14: warning[core.BitwiseShift]: Right shift overflows the capacity of 'OPJ_UINT32'
#  227|   static INLINE OPJ_UINT32 opj_uint_floordivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
#  228|   {
#  229|->     return a >> b;
#  230|   }
#  231|   

Error: CPPCHECK_WARNING: [#def106]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/pi.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def107]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/pi.c:252:9: warning[deadcode.DeadStores]: Value stored to 'res' is never read
#  250|       if (!pi->first) {
#  251|           comp = &pi->comps[pi->compno];
#  252|->         res = &comp->resolutions[pi->resno];
#  253|           goto LABEL_SKIP;
#  254|       } else {

Error: CLANG_WARNING: [#def108]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/pi.c:312:9: warning[deadcode.DeadStores]: Value stored to 'res' is never read
#  310|       if (!pi->first) {
#  311|           comp = &pi->comps[pi->compno];
#  312|->         res = &comp->resolutions[pi->resno];
#  313|           goto LABEL_SKIP;
#  314|       } else {

Error: CLANG_WARNING: [#def109]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/pi.c:1914:13: warning[deadcode.DeadStores]: Value stored to 'incr_top' is never read
# 1912|                   }
# 1913|               }
# 1914|->             incr_top = 1;
# 1915|           } else {
# 1916|               for (i = tppos; i >= 0; i--) {

Error: CPPCHECK_WARNING: [#def110]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/sparse_array.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def111]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/t1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def112]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/t2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def113]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/t2.c:256:9: warning[deadcode.DeadStores]: Value stored to 'l_current_pi' is never read
#  254|   
#  255|       if (p_t2_mode == THRESH_CALC) { /* Calculating threshold */
#  256|->         l_current_pi = l_pi;
#  257|   
#  258|           for (compno = 0; compno < l_max_comp; ++compno) {

Error: CLANG_WARNING: [#def114]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/t2.c:1029:5: warning[deadcode.DeadStores]: Value stored to 'p_src' is never read
# 1027|       }
# 1028|   
# 1029|->     p_src += l_nb_bytes_read;
# 1030|       l_nb_total_bytes_read += l_nb_bytes_read;
# 1031|       p_max_length -= l_nb_bytes_read;

Error: CPPCHECK_WARNING: [#def115]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/tcd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def116]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/tcd.c:425:25: warning[deadcode.DeadStores]: Value stored to 'n' is never read
#  423|                           }
#  424|   
#  425|->                         n = cblk->numpassesinlayers;
#  426|                           if (cblk->numpassesinlayers == 0) {
#  427|                               if (value != 0) {

Error: CPPCHECK_WARNING: [#def117]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/tgt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def118]
openjpeg2-2.5.2-build/openjpeg-2.5.2/src/lib/openjp2/thread.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-192.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameopenjpeg2-2.5.2-1.fc41
store-results-to/tmp/tmpl88mdamm/openjpeg2-2.5.2-1.fc41.tar.xz
time-created2024-07-03 16:26:43
time-finished2024-07-03 16:29:20
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpl88mdamm/openjpeg2-2.5.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpl88mdamm/openjpeg2-2.5.2-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9