openjpeg-2.5.4-2.fc44

List of Findings

Error: COMPILER_WARNING: [#def1] [important]
openjpeg-2.5.4/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-cWUjAZ/CheckSymbolExists.c:8:19: error[error]: ‘_aligned_malloc’ undeclared (first use in this function)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
openjpeg-2.5.4/redhat-linux-build/CMakeFiles/TestLargeFiles.c:17:18: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(*argv, "r")’ where non-null expected
openjpeg-2.5.4/redhat-linux-build/CMakeFiles/TestLargeFiles.c:16:14: acquire_memory: this call could return NULL
openjpeg-2.5.4/redhat-linux-build/CMakeFiles/TestLargeFiles.c:17:18: danger: argument 1 (‘fopen(*argv, "r")’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   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: GCC_ANALYZER_WARNING (CWE-476): [#def3]
openjpeg-2.5.4/src/bin/common/opj_getopt.c:103:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘oli’
openjpeg-2.5.4/src/bin/common/opj_getopt.c:91:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/common/opj_getopt.c:94:14: branch_false: ...to here
openjpeg-2.5.4/src/bin/common/opj_getopt.c:103:9: danger: dereference of NULL ‘oli’
#  101|           }
#  102|       }
#  103|->     if (*++oli != ':') {      /* don't need argument */
#  104|           opj_optarg = NULL;
#  105|           if (!*place) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
openjpeg-2.5.4/src/bin/jp2/convert.c:599:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:766:14: enter_function: entry to ‘tgatoimage’
openjpeg-2.5.4/src/bin/jp2/convert.c:781:9: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convert.c:782:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:787:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:787:10: call_function: calling ‘tga_readheader’ from ‘tgatoimage’
#  597|       unsigned short /*x_origin, y_origin,*/ image_w, image_h;
#  598|   
#  599|->     if (!bits_per_pixel || !width || !height || !flip_image) {
#  600|           return 0;
#  601|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
openjpeg-2.5.4/src/bin/jp2/convert.c:599:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:766:14: enter_function: entry to ‘tgatoimage’
openjpeg-2.5.4/src/bin/jp2/convert.c:781:9: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:782:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:787:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:787:10: call_function: calling ‘tga_readheader’ from ‘tgatoimage’
#  597|       unsigned short /*x_origin, y_origin,*/ image_w, image_h;
#  598|   
#  599|->     if (!bits_per_pixel || !width || !height || !flip_image) {
#  600|           return 0;
#  601|       }

Error: GCC_ANALYZER_WARNING (CWE-789): [#def6]
openjpeg-2.5.4/src/bin/jp2/convert.c:631:47: warning[-Wanalyzer-tainted-allocation-size]: use of attacker-controlled value as allocation size without upper-bounds checking
openjpeg-2.5.4/src/bin/jp2/convert.c:599:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:603:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:608:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:630:8: branch_true: following ‘true’ branch (when ‘id_len != 0’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:631:47: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:631:47: danger: use of attacker-controlled value as allocation size without upper-bounds checking
#  629|       /* Ignore tga identifier, if present ... */
#  630|       if (id_len) {
#  631|->         unsigned char *id = (unsigned char *) malloc(id_len);
#  632|           if (id == 0) {
#  633|               fprintf(stderr, "tga_readheader: memory out\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:1179:9: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convert.c:1180:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1183|       }
# 1184|   
# 1185|->     fseek(f, 0, SEEK_SET);
# 1186|       if (fscanf(f, "PG%31[ \t]%c%c%31[ \t+-]%d%31[ \t]%d%31[ \t]%d", temp, &endian1,
# 1187|                  &endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:1179:9: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:1180:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:1185:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1183|       }
# 1184|   
# 1185|->     fseek(f, 0, SEEK_SET);
# 1186|       if (fscanf(f, "PG%31[ \t]%c%c%31[ \t+-]%d%31[ \t]%d%31[ \t]%d", temp, &endian1,
# 1187|                  &endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {

Error: GCC_ANALYZER_WARNING (CWE-122): [#def9]
openjpeg-2.5.4/src/bin/jp2/convert.c:1383:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
openjpeg-2.5.4/src/bin/jp2/convert.c:1361:22: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1362:35: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1371:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1376:12: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1376:12: branch_true: following ‘true’ branch (when ‘total > 256’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:1377:27: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1378:16: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:1383:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1383:9: danger: write of ‘dotpos’ bytes at offset ‘0’ exceeds the buffer
# 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): [#def10]
openjpeg-2.5.4/src/bin/jp2/convert.c:1384:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
openjpeg-2.5.4/src/bin/jp2/convert.c:1361:22: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1362:35: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1371:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:1376:12: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1376:12: branch_true: following ‘true’ branch (when ‘total > 256’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:1377:27: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1378:16: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:1383:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:1384:9: danger: out-of-bounds write
# 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: GCC_ANALYZER_WARNING (CWE-775): [#def11]
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(destname, "wb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: following ‘false’ branch (when ‘prec <= 16’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: following ‘false’ branch (when ‘destname’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2220:22: branch_true: following ‘true’ branch (when ‘compno < ncomp’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2221:12: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2232:17: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convert.c:2233:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: throw: if ‘opj_version’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: danger: ‘fopen(destname, "wb")’ leaks here; was opened at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
# 2236|               return 1;
# 2237|           }
# 2238|->         wr = (int)image->comps[compno].w;
# 2239|           hr = (int)image->comps[compno].h;
# 2240|           prec = (int)image->comps[compno].prec;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(destname, "wb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: following ‘false’ branch (when ‘prec <= 16’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: following ‘false’ branch (when ‘destname’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2220:22: branch_true: following ‘true’ branch (when ‘compno < ncomp’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2221:12: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2232:17: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:2233:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: throw: if ‘opj_version’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: danger: ‘fopen(destname, "wb")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/6)
# 2236|               return 1;
# 2237|           }
# 2238|->         wr = (int)image->comps[compno].w;
# 2239|           hr = (int)image->comps[compno].h;
# 2240|           prec = (int)image->comps[compno].prec;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: warning[-Wanalyzer-malloc-leak]: leak of ‘destname’
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: following ‘false’ branch (when ‘prec <= 16’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2029:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2215:23: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: following ‘false’ branch (when ‘destname’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2216:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2220:22: branch_true: following ‘true’ branch (when ‘compno < ncomp’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2221:12: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2233:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2238:19: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: throw: if ‘opj_version’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: danger: ‘destname’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 2241|           max = (1 << prec) - 1;
# 2242|   
# 2243|->         fprintf(fdest, "P5\n#OpenJPEG-%s\n%d %d\n%d\n",
# 2244|                   opj_version(), wr, hr, max);
# 2245|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
openjpeg-2.5.4/src/bin/jp2/convert.c:2353:47: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:2318:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2333:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2333:9: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convert.c:2334:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2339:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: following ‘false’ branch (when ‘cmptparm’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2362:17: branch_false: following ‘false’ branch (when ‘i >= numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: throw: if ‘opj_image_create’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2353:47: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 2351|       w = raw_cp->rawWidth;
# 2352|       h = raw_cp->rawHeight;
# 2353|->     cmptparm = (opj_image_cmptparm_t*) calloc((OPJ_UINT32)numcomps,
# 2354|                  sizeof(opj_image_cmptparm_t));
# 2355|       if (!cmptparm) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
openjpeg-2.5.4/src/bin/jp2/convert.c:2353:47: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convert.c:2318:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2333:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2333:9: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:2334:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2339:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: following ‘false’ branch (when ‘cmptparm’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2362:17: branch_false: following ‘false’ branch (when ‘i >= numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: throw: if ‘opj_image_create’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2353:47: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 2351|       w = raw_cp->rawWidth;
# 2352|       h = raw_cp->rawHeight;
# 2353|->     cmptparm = (opj_image_cmptparm_t*) calloc((OPJ_UINT32)numcomps,
# 2354|                  sizeof(opj_image_cmptparm_t));
# 2355|       if (!cmptparm) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: warning[-Wanalyzer-malloc-leak]: leak of ‘cmptparm’
openjpeg-2.5.4/src/bin/jp2/convert.c:2318:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2333:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2334:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2339:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2353:40: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: following ‘false’ branch (when ‘cmptparm’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2355:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2362:17: branch_false: following ‘false’ branch (when ‘i >= numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: throw: if ‘opj_image_create’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: danger: ‘cmptparm’ leaks here; was allocated at [(5)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/4)
# 2369|       }
# 2370|       /* create the image */
# 2371|->     image = opj_image_create((OPJ_UINT32)numcomps, &cmptparm[0], color_space);
# 2372|       free(cmptparm);
# 2373|       if (!image) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:322:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:702:14: enter_function: entry to ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:720:10: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:721:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: call_function: calling ‘bmp_read_info_header’ from ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: return_function: returning to ‘bmptoimage’ from ‘bmp_read_info_header’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:736:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:750:26: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: following ‘false’ branch (when ‘has_color == 0’)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:773:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:777:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:788:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:793:8: branch_false: following ‘false’ branch (when ‘pData’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:322:23: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  320|   static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
#  321|   {
#  322|->     header->bfType  = (OPJ_UINT16)getc(IN);
#  323|       header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:322:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:702:14: enter_function: entry to ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:720:10: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:721:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: call_function: calling ‘bmp_read_info_header’ from ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: return_function: returning to ‘bmptoimage’ from ‘bmp_read_info_header’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:736:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:750:26: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: following ‘false’ branch (when ‘has_color == 0’)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:773:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:777:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:788:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:793:8: branch_false: following ‘false’ branch (when ‘pData’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:322:23: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  320|   static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
#  321|   {
#  322|->     header->bfType  = (OPJ_UINT16)getc(IN);
#  323|       header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pData’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:702:14: enter_function: entry to ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:721:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: call_function: calling ‘bmp_read_info_header’ from ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: return_function: returning to ‘bmptoimage’ from ‘bmp_read_info_header’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:736:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:750:26: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: following ‘false’ branch (when ‘has_color == 0’)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:773:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:777:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:788:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:27: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:793:8: branch_false: following ‘false’ branch (when ‘pData’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: danger: ‘pData’ leaks here; was allocated at [(23)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/22)
#  796|       }
#  797|       /* Place the cursor at the beginning of the image information */
#  798|->     fseek(IN, 0, SEEK_SET);
#  799|       fseek(IN, (long)File_h.bfOffBits, SEEK_SET);
#  800|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:799:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pData’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:702:14: enter_function: entry to ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:721:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:726:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: call_function: calling ‘bmp_read_info_header’ from ‘bmptoimage’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:10: return_function: returning to ‘bmptoimage’ from ‘bmp_read_info_header’
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:730:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:736:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:750:26: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:757:16: branch_false: following ‘false’ branch (when ‘has_color == 0’)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:768:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:773:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:777:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:788:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:792:27: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:793:8: branch_false: following ‘false’ branch (when ‘pData’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:799:5: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:799:5: danger: ‘pData’ leaks here; was allocated at [(23)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/22)
#  797|       /* Place the cursor at the beginning of the image information */
#  798|       fseek(IN, 0, SEEK_SET);
#  799|->     fseek(IN, (long)File_h.bfOffBits, SEEK_SET);
#  800|   
#  801|       switch (Info_h.biCompression) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(read_idf, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:255:19: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:255:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266:16: throw: if ‘png_create_read_struct’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: danger: ‘fopen(read_idf, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  259|   
#  260|       if (fread(sigbuf, 1, MAGIC_SIZE, reader) != MAGIC_SIZE
#  261|->             || memcmp(sigbuf, PNG_MAGIC, MAGIC_SIZE) != 0) {
#  262|           fprintf(stderr, "pngtoimage: %s is no valid PNG file\n", read_idf);
#  263|           goto fin;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(read_idf, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:255:19: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:255:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:260:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266:16: throw: if ‘png_create_read_struct’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:261:16: danger: ‘fopen(read_idf, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  259|   
#  260|       if (fread(sigbuf, 1, MAGIC_SIZE, reader) != MAGIC_SIZE
#  261|->             || memcmp(sigbuf, PNG_MAGIC, MAGIC_SIZE) != 0) {
#  262|           fprintf(stderr, "pngtoimage: %s is no valid PNG file\n", read_idf);
#  263|           goto fin;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(write_idf, "wb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:325:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:331:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: following ‘false’ branch (when ‘nr_comp == i’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:14: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:5: danger: ‘fopen(write_idf, "wb")’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  392|       }
#  393|   
#  394|->     writer = fopen(write_idf, "wb");
#  395|   
#  396|       if (writer == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(write_idf, "wb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:325:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:331:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: following ‘false’ branch (when ‘nr_comp == i’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:14: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:394:5: danger: ‘fopen(write_idf, "wb")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  392|       }
#  393|   
#  394|->     writer = fopen(write_idf, "wb");
#  395|   
#  396|       if (writer == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:9: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(png_get_rowbytes(png,  info))’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:325:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:331:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: following ‘false’ branch (when ‘nr_comp == i’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:396:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:406:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:410:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:416:12: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:418:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: setjmp: ‘setjmp’ called here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:431:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:452:8: branch_false: following ‘false’ branch (when ‘nr_comp <= 2’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:457:24: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:459:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:464:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:480:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:30: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:30: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:9: danger: ‘malloc(png_get_rowbytes(png,  info))’ leaks here; was allocated at [(20)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/19)
#  482|               goto fin;
#  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");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:489:9: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)*image_173(D)->comps.w * (long unsigned int)nr_comp * 4)’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:325:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:331:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: following ‘false’ branch (when ‘nr_comp == i’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:396:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:406:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:410:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:416:12: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:418:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: setjmp: ‘setjmp’ called here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:431:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:452:8: branch_false: following ‘false’ branch (when ‘nr_comp <= 2’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:457:24: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:459:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:464:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:480:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:30: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:30: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:485:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:489:40: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:489:33: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:489:9: danger: ‘malloc((long unsigned int)*image_173(D)->comps.w * (long unsigned int)nr_comp * 4)’ leaks here; was allocated at [(23)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/22)
#  487|               goto fin;
#  488|           }
#  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) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:524:13: warning[-Wanalyzer-jump-through-null]: jump through null pointer
openjpeg-2.5.4/src/bin/jp2/convertpng.c:325:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:331:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: following ‘false’ branch (when ‘nr_comp == i’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:357:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:396:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:406:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:410:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:416:12: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:418:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:9: setjmp: ‘setjmp’ called here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:425:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:431:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:452:8: branch_false: following ‘false’ branch (when ‘nr_comp <= 2’)...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:457:24: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:459:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:464:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:480:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:484:30: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:485:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:489:40: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:491:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:501:26: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:522:21: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:523:13: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:524:13: danger: jump through null pointer here
#  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: GCC_ANALYZER_WARNING (CWE-401): [#def28]
openjpeg-2.5.4/src/bin/jp2/converttif.c:736:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_true: following ‘true’ branch (when ‘buffer32s’ is NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:736:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:736:9: throw: if ‘_TIFFfree’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:736:9: danger: ‘buf’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  734|       buffer32s = (OPJ_INT32 *)malloc(sizeof(OPJ_INT32) * width * numcomps);
#  735|       if (buffer32s == NULL) {
#  736|->         _TIFFfree(buf);
#  737|           TIFFClose(tif);
#  738|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer32s’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:30: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: throw: if the called function throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: danger: ‘buffer32s’ leaks here; was allocated at [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18)
#  740|   
#  741|       for (i = 0; i < image->comps[0].h; ++i) {
#  742|->         cvtPxToCx(planes, buffer32s, (OPJ_SIZE_T)width, adjust);
#  743|           cvt32sToTif(buffer32s, (OPJ_BYTE *)buf, (OPJ_SIZE_T)width * numcomps);
#  744|           (void)TIFFWriteEncodedStrip(tif, i, (void*)buf, (tsize_t)strip_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: throw: if the called function throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: danger: ‘buf’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#  740|   
#  741|       for (i = 0; i < image->comps[0].h; ++i) {
#  742|->         cvtPxToCx(planes, buffer32s, (OPJ_SIZE_T)width, adjust);
#  743|           cvt32sToTif(buffer32s, (OPJ_BYTE *)buf, (OPJ_SIZE_T)width * numcomps);
#  744|           (void)TIFFWriteEncodedStrip(tif, i, (void*)buf, (tsize_t)strip_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
openjpeg-2.5.4/src/bin/jp2/converttif.c:743:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:742:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:743:9: throw: if the called function throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:743:9: danger: ‘buf’ leaks here; was allocated at [(17)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/16)
#  741|       for (i = 0; i < image->comps[0].h; ++i) {
#  742|           cvtPxToCx(planes, buffer32s, (OPJ_SIZE_T)width, adjust);
#  743|->         cvt32sToTif(buffer32s, (OPJ_BYTE *)buf, (OPJ_SIZE_T)width * numcomps);
#  744|           (void)TIFFWriteEncodedStrip(tif, i, (void*)buf, (tsize_t)strip_size);
#  745|           planes[0] += width;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer32s’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:30: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: throw: if ‘_TIFFfree’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: danger: ‘buffer32s’ leaks here; was allocated at [(19)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/18)
#  748|           planes[3] += width;
#  749|       }
#  750|->     _TIFFfree((void*)buf);
#  751|       TIFFClose(tif);
#  752|       free(buffer32s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: throw: if ‘_TIFFfree’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: danger: ‘buf’ leaks here; was allocated at [(17)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/16)
#  748|           planes[3] += width;
#  749|       }
#  750|->     _TIFFfree((void*)buf);
#  751|       TIFFClose(tif);
#  752|       free(buffer32s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
openjpeg-2.5.4/src/bin/jp2/converttif.c:751:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer32s’
openjpeg-2.5.4/src/bin/jp2/converttif.c:626:8: branch_false: following ‘false’ branch (when ‘i == numcomps’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:633:8: branch_false: following ‘false’ branch (when ‘bps <= 16’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:636:8: branch_false: following ‘false’ branch (when ‘bps != 0’)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:641:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:642:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:716:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:715:9: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:723:28: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:724:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:729:11: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:730:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:37: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:734:30: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: following ‘false’ branch (when ‘buffer32s’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/converttif.c:735:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:741:17: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/converttif.c:750:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/converttif.c:751:5: throw: if ‘TIFFClose’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/converttif.c:751:5: danger: ‘buffer32s’ leaks here; was allocated at [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
#  749|       }
#  750|       _TIFFfree((void*)buf);
#  751|->     TIFFClose(tif);
#  752|       free(buffer32s);
#  753|   

Error: CPPCHECK_WARNING (CWE-190): [#def35]
openjpeg-2.5.4/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): [#def36]
openjpeg-2.5.4/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): [#def37]
openjpeg-2.5.4/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): [#def38]
openjpeg-2.5.4/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): [#def39]
openjpeg-2.5.4/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): [#def40]
openjpeg-2.5.4/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): [#def41]
openjpeg-2.5.4/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): [#def42]
openjpeg-2.5.4/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): [#def43]
openjpeg-2.5.4/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): [#def44]
openjpeg-2.5.4/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): [#def45]
openjpeg-2.5.4/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): [#def46]
openjpeg-2.5.4/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): [#def47]
openjpeg-2.5.4/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): [#def48]
openjpeg-2.5.4/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): [#def49]
openjpeg-2.5.4/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): [#def50]
openjpeg-2.5.4/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): [#def51]
openjpeg-2.5.4/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): [#def52]
openjpeg-2.5.4/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): [#def53]
openjpeg-2.5.4/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): [#def54]
openjpeg-2.5.4/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): [#def55]
openjpeg-2.5.4/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): [#def56]
openjpeg-2.5.4/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): [#def57]
openjpeg-2.5.4/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): [#def58]
openjpeg-2.5.4/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): [#def59]
openjpeg-2.5.4/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): [#def60]
openjpeg-2.5.4/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): [#def61]
openjpeg-2.5.4/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): [#def62]
openjpeg-2.5.4/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): [#def63]
openjpeg-2.5.4/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): [#def64]
openjpeg-2.5.4/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): [#def65]
openjpeg-2.5.4/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): [#def66]
openjpeg-2.5.4/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): [#def67]
openjpeg-2.5.4/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): [#def68]
openjpeg-2.5.4/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): [#def69]
openjpeg-2.5.4/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): [#def70]
openjpeg-2.5.4/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): [#def71]
openjpeg-2.5.4/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): [#def72]
openjpeg-2.5.4/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): [#def73]
openjpeg-2.5.4/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): [#def74]
openjpeg-2.5.4/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): [#def75]
openjpeg-2.5.4/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): [#def76]
openjpeg-2.5.4/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): [#def77]
openjpeg-2.5.4/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): [#def78]
openjpeg-2.5.4/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): [#def79]
openjpeg-2.5.4/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): [#def80]
openjpeg-2.5.4/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): [#def81]
openjpeg-2.5.4/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): [#def82]
openjpeg-2.5.4/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: GCC_ANALYZER_WARNING (CWE-401): [#def83]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:488:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:481:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:482:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:482:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:488:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:488:23: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  486|   
#  487|       num_images = 0;
#  488|->     while ((content = readdir(dir)) != NULL) {
#  489|           if (strcmp(".", content->d_name) == 0 || strcmp("..", content->d_name) == 0) {
#  490|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:516:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:511:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:512:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:516:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:519:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:516:9: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  514|           return 1;
#  515|       } else   {
#  516|->         fprintf(stderr, "Folder opened successfully\n");
#  517|       }
#  518|   

Error: CPPCHECK_WARNING (CWE-476): [#def85]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:524: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dirptr
#  522|           }
#  523|   
#  524|->         strcpy(dirptr->filename[i], content->d_name);
#  525|           i++;
#  526|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def86]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:586:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fname’ where non-null expected
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:559:13: enter_function: entry to ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:569:32: call_function: calling ‘get_file_format’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:569:32: return_function: returning to ‘get_next_file’ from ‘get_file_format’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:570:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:573:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:573:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:577:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:580:9: call_function: calling ‘opj_strcpy_s’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:580:9: return_function: returning to ‘get_next_file’ from ‘opj_strcpy_s’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:580:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:586:25: call_function: inlined call to ‘get_file_name’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:586:5: danger: argument 2 (‘fname’) NULL where non-null expected
#  584|   
#  585|       /*Set output file*/
#  586|->     strcpy(temp_ofname, get_file_name(image_filename));
#  587|       while ((temp_p = strtok(NULL, ".")) != NULL) {
#  588|           strcat(temp_ofname, temp1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: danger: ‘fopen(lFilename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1329|   
# 1330|               /* Set size of file and read its content*/
# 1331|->             fseek(lFile, 0, SEEK_END);
# 1332|               lStrLen = (size_t)ftell(lFile);
# 1333|               fseek(lFile, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: danger: ‘fopen(lFilename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1329|   
# 1330|               /* Set size of file and read its content*/
# 1331|->             fseek(lFile, 0, SEEK_END);
# 1332|               lStrLen = (size_t)ftell(lFile);
# 1333|               fseek(lFile, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: throw: if ‘ftell’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: danger: ‘fopen(lFilename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1330|               /* Set size of file and read its content*/
# 1331|               fseek(lFile, 0, SEEK_END);
# 1332|->             lStrLen = (size_t)ftell(lFile);
# 1333|               fseek(lFile, 0, SEEK_SET);
# 1334|               lMatrix = (char *) malloc(lStrLen + 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: throw: if ‘ftell’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1332:31: danger: ‘fopen(lFilename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1330|               /* Set size of file and read its content*/
# 1331|               fseek(lFile, 0, SEEK_END);
# 1332|->             lStrLen = (size_t)ftell(lFile);
# 1333|               fseek(lFile, 0, SEEK_SET);
# 1334|               lMatrix = (char *) malloc(lStrLen + 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_resource: opened here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: danger: ‘fopen(lFilename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1331|               fseek(lFile, 0, SEEK_END);
# 1332|               lStrLen = (size_t)ftell(lFile);
# 1333|->             fseek(lFile, 0, SEEK_SET);
# 1334|               lMatrix = (char *) malloc(lStrLen + 1);
# 1335|               if (lMatrix == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lFilename, "r")’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1325:28: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: throw: if ‘fseek’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1333:13: danger: ‘fopen(lFilename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1331|               fseek(lFile, 0, SEEK_END);
# 1332|               lStrLen = (size_t)ftell(lFile);
# 1333|->             fseek(lFile, 0, SEEK_SET);
# 1334|               lMatrix = (char *) malloc(lStrLen + 1);
# 1335|               if (lMatrix == NULL) {

Error: GCC_ANALYZER_WARNING: [#def93]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1363:32: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1335:16: branch_false: following ‘false’ branch (when ‘lMatrix’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1339:25: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1341:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1346:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1363:32: danger: at least one operand of the size argument is of a floating-point type
# 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: GCC_ANALYZER_WARNING (CWE-401): [#def94]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lCurrentDoublePtr’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1335:16: branch_false: following ‘false’ branch (when ‘lMatrix’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1339:25: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1341:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1346:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1363:32: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1364:16: branch_false: following ‘false’ branch (when ‘lSpace’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1364:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1369:26: branch_false: following ‘false’ branch (when ‘i2 >= lMctComp’)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1369:26: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1376:26: branch_false: following ‘false’ branch (when ‘i2 >= lNbComp’)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: throw: if ‘opj_set_MCT’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: danger: ‘lCurrentDoublePtr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 1381|   
# 1382|               /* TODO should not be here ! */
# 1383|->             opj_set_MCT(parameters, lSpace, (int *)(lSpace + lMctComp),
# 1384|                           (OPJ_UINT32)lNbComp);
# 1385|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lCurrentPtr’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:657:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:660:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1326:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1331:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1334:32: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1335:16: branch_false: following ‘false’ branch (when ‘lMatrix’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1339:25: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1341:16: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1346:20: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1364:16: branch_false: following ‘false’ branch (when ‘lSpace’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1364:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1369:26: branch_false: following ‘false’ branch (when ‘i2 >= lMctComp’)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1369:26: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1376:26: branch_false: following ‘false’ branch (when ‘i2 >= lNbComp’)...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: throw: if ‘opj_set_MCT’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1383:13: danger: ‘lCurrentPtr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1381|   
# 1382|               /* TODO should not be here ! */
# 1383|->             opj_set_MCT(parameters, lSpace, (int *)(lSpace + lMctComp),
# 1384|                           (OPJ_UINT32)lNbComp);
# 1385|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:392:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:386:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:387:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:387:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:392:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:392:23: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  390|       }
#  391|   
#  392|->     while ((content = readdir(dir)) != NULL) {
#  393|           if (strcmp(".", content->d_name) == 0 || strcmp("..", content->d_name) == 0) {
#  394|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:422:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:417:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:418:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:422:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:425:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:422:9: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  420|           return 1;
#  421|       } else   {
#  422|->         fprintf(stderr, "Folder opened successfully\n");
#  423|       }
#  424|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def98]
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:508:5: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:482:6: enter_function: entry to ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:491:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:495:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:499:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:502:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:502:9: call_function: calling ‘opj_strcpy_s’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:502:9: return_function: returning to ‘get_next_file’ from ‘opj_strcpy_s’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:502:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:508:25: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:508:5: danger: argument 2 (‘strtok(&image_filename, ".")’) NULL where non-null expected
#  506|   
#  507|       /*Set output file*/
#  508|->     strcpy(temp_ofname, strtok(image_filename, "."));
#  509|       while ((temp_p = strtok(NULL, ".")) != NULL) {
#  510|           strcat(temp_ofname, temp1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1130:19: warning[-Wanalyzer-malloc-leak]: leak of ‘l_new_components’
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1093:47: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1095:8: branch_false: following ‘false’ branch (when ‘l_new_components’ is non-NULL)...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1103:36: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1130:19: throw: if ‘opj_image_create’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:1130:19: danger: ‘l_new_components’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1128|       }
# 1129|   
# 1130|->     l_new_image = opj_image_create(original->numcomps + 2U, l_new_components,
# 1131|                                      OPJ_CLRSPC_SRGB);
# 1132|       free(l_new_components);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:100:5: warning[-Wanalyzer-malloc-leak]: leak of ‘img_fol.imgdirpath’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:486:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:509:9: call_function: calling ‘parse_cmdline_decoder’ from ‘main’
#   98|   static void decode_help_display(void)
#   99|   {
#  100|->     fprintf(stdout, "\nThis is the opj_dump utility from the OpenJPEG project.\n"
#  101|               "It dumps JPEG 2000 codestream info to stdout or a given file.\n"
#  102|               "It has been compiled against openjp2 library v%s.\n\n", opj_version());

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:141:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:135:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:136:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:136:8: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:141:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:141:23: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  139|       }
#  140|   
#  141|->     while ((content = readdir(dir)) != NULL) {
#  142|           if (strcmp(".", content->d_name) == 0 || strcmp("..", content->d_name) == 0) {
#  143|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:170:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(imgdirpath)’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:165:11: acquire_memory: allocated here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:166:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:170:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:173:23: throw: if ‘readdir’ throws an exception...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:170:9: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  168|           return 1;
#  169|       } else   {
#  170|->         fprintf(stderr, "Folder opened successfully\n");
#  171|       }
#  172|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def103]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:251:5: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:224:13: enter_function: entry to ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:234:32: call_function: calling ‘get_file_format’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:234:32: return_function: returning to ‘get_next_file’ from ‘get_file_format’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:235:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:238:16: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:238:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:242:5: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:245:9: call_function: calling ‘opj_strcpy_s’ from ‘get_next_file’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:245:9: return_function: returning to ‘get_next_file’ from ‘opj_strcpy_s’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:245:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:251:25: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:251:5: danger: argument 2 (‘strtok(&image_filename, ".")’) NULL where non-null expected
#  249|   
#  250|       /*Set output file*/
#  251|->     strcpy(temp_ofname, strtok(image_filename, "."));
#  252|       while ((temp_p = strtok(NULL, ".")) != NULL) {
#  253|           strcat(temp_ofname, temp1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:402:13: warning[-Wanalyzer-malloc-leak]: leak of ‘img_fol.imgdirpath’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:486:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:509:9: call_function: calling ‘parse_cmdline_decoder’ from ‘main’
#  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: COMPILER_WARNING: [#def105]
openjpeg-2.5.4/src/lib/openjp2/ht_dec.c: scope_hint: In function ‘opj_t1_ht_decode_cblk’
openjpeg-2.5.4/src/lib/openjp2/ht_dec.c:2222:41: warning[-Wunused-but-set-variable=]: variable ‘dp’ set but not used
# 2222 |                             OPJ_UINT32 *dp = decoded_data + (y - 8) * stride;
#      |                                         ^~
# 2220|                               OPJ_UINT32 cnt = 0;
# 2221|   
# 2222|->                             OPJ_UINT32 *dp = decoded_data + (y - 8) * stride;
# 2223|                               dp += i + n; //address for decoded samples
# 2224|   

Error: COMPILER_WARNING: [#def106]
openjpeg-2.5.4/src/lib/openjp2/ht_dec.c:2534:37: warning[-Wunused-but-set-variable=]: variable ‘dp’ set but not used
# 2534 |                         OPJ_UINT32 *dp = decoded_data + y * stride;
#      |                                     ^~
# 2532|                           OPJ_UINT32 cnt = 0;
# 2533|   
# 2534|->                         OPJ_UINT32 *dp = decoded_data + y * stride;
# 2535|                           dp += i + n;
# 2536|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def107]
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4776:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘marker_info’
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4835:17: enter_function: entry to ‘opj_j2k_write_sod’
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4912:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4923:13: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4922:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4929:5: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4931:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4942:5: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4944:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4945:20: branch_true: ...to here
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4948:12: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4953:14: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4953:14: call_function: calling ‘opj_j2k_write_plt_in_memory’ from ‘opj_j2k_write_sod’
# 4774|       Lplt = 3;
# 4775|   
# 4776|->     for (i = 0; i < marker_info->packet_count; i++) {
# 4777|           OPJ_BYTE var_bytes[5];
# 4778|           OPJ_UINT8 var_bytes_size = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname,  mode)’
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1098:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1102:8: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1108:14: acquire_resource: opened here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1110:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: throw: if ‘opj_stream_create’ throws an exception...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: danger: ‘fopen(fname,  mode)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1112|       }
# 1113|   
# 1114|->     l_stream = opj_stream_create(p_size, p_is_read_stream);
# 1115|       if (! l_stream) {
# 1116|           fclose(p_file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname,  mode)’
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1098:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1102:8: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1108:14: acquire_memory: allocated here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1110:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: throw: if ‘opj_stream_create’ throws an exception...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: danger: ‘fopen(fname,  mode)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1112|       }
# 1113|   
# 1114|->     l_stream = opj_stream_create(p_size, p_is_read_stream);
# 1115|       if (! l_stream) {
# 1116|           fclose(p_file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname,  mode)’
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1098:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1102:8: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1108:14: acquire_resource: opened here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1110:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1115:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: throw: if ‘opj_stream_set_user_data’ throws an exception...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: danger: ‘fopen(fname,  mode)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1118|       }
# 1119|   
# 1120|->     opj_stream_set_user_data(l_stream, p_file, opj_close_from_file);
# 1121|       opj_stream_set_user_data_length(l_stream,
# 1122|                                       opj_get_data_length_from_file(p_file));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname,  mode)’
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1098:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1102:8: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1108:14: acquire_memory: allocated here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1110:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1114:16: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1115:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: branch_false: ...to here
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: throw: if ‘opj_stream_set_user_data’ throws an exception...
openjpeg-2.5.4/src/lib/openjp2/openjpeg.c:1120:5: danger: ‘fopen(fname,  mode)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1118|       }
# 1119|   
# 1120|->     opj_stream_set_user_data(l_stream, p_file, opj_close_from_file);
# 1121|       opj_stream_set_user_data_length(l_stream,
# 1122|                                       opj_get_data_length_from_file(p_file));

Error: COMPILER_WARNING: [#def112]
openjpeg-2.5.4/src/lib/openjp2/pi.c: scope_hint: In function ‘opj_pi_create_decode’
openjpeg-2.5.4/src/lib/openjp2/pi.c:1415:23: warning[-Wunused-but-set-variable=]: variable ‘l_tccp’ set but not used
# 1415 |     const opj_tccp_t *l_tccp = 00;
#      |                       ^~~~~~
# 1413|       opj_pi_iterator_t *l_pi = 00;
# 1414|       opj_tcp_t *l_tcp = 00;
# 1415|->     const opj_tccp_t *l_tccp = 00;
# 1416|       opj_pi_comp_t *l_current_comp = 00;
# 1417|       opj_image_comp_t * l_img_comp = 00;

Error: COMPILER_WARNING: [#def113]
openjpeg-2.5.4/src/lib/openjp2/pi.c: scope_hint: In function ‘opj_pi_initialise_encode’
openjpeg-2.5.4/src/lib/openjp2/pi.c:1638:23: warning[-Wunused-but-set-variable=]: variable ‘l_tccp’ set but not used
# 1638 |     const opj_tccp_t *l_tccp = 00;
#      |                       ^~~~~~
# 1636|       opj_pi_iterator_t *l_pi = 00;
# 1637|       opj_tcp_t *l_tcp = 00;
# 1638|->     const opj_tccp_t *l_tccp = 00;
# 1639|       opj_pi_comp_t *l_current_comp = 00;
# 1640|       opj_image_comp_t * l_img_comp = 00;

Error: COMPILER_WARNING: [#def114]
openjpeg-2.5.4/src/lib/openjp2/tcd.c: scope_hint: In function ‘opj_tcd_dc_level_shift_encode’
openjpeg-2.5.4/src/lib/openjp2/tcd.c:2474:24: warning[-Wunused-but-set-variable=]: variable ‘l_img_comp’ set but not used
# 2474 |     opj_image_comp_t * l_img_comp = 00;
#      |                        ^~~~~~~~~~
# 2472|       opj_tcd_tilecomp_t * l_tile_comp = 00;
# 2473|       opj_tccp_t * l_tccp = 00;
# 2474|->     opj_image_comp_t * l_img_comp = 00;
# 2475|       opj_tcd_tile_t * l_tile;
# 2476|       OPJ_SIZE_T l_nb_elem, i;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-237.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameopenjpeg-2.5.4-2.fc44
store-results-to/tmp/tmpzatzumo5/openjpeg-2.5.4-2.fc44.tar.xz
time-created2026-01-08 19:58:41
time-finished2026-01-08 20:01:19
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpzatzumo5/openjpeg-2.5.4-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpzatzumo5/openjpeg-2.5.4-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9