openjpeg-2.5.4-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
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): [#def2]
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): [#def3]
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: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/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): [#def4]
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: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/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): [#def5]
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): [#def6]
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): [#def7]
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: 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’)...
 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)...
 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:2221:12: branch_true: following ‘true’ branch (when ‘ncomp != 1’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2223:33: 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: danger: ‘fopen(destname, "wb")’ leaks here; was opened at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 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-401): [#def8]
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’)...
 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)...
 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:2221:12: branch_true: following ‘true’ branch (when ‘ncomp != 1’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2223:33: 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: danger: ‘destname’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/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-401): [#def9]
openjpeg-2.5.4/src/bin/jp2/convert.c:2243:9: 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’)...
 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)...
 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:2221:12: branch_true: following ‘true’ branch (when ‘ncomp != 1’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2223:33: 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: danger: ‘fopen(destname, "wb")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 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): [#def10]
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: 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)...
 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: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 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-401): [#def11]
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)...
 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: danger: ‘cmptparm’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/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-401): [#def12]
openjpeg-2.5.4/src/bin/jp2/convert.c:2371:13: 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)...
 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: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 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): [#def13]
openjpeg-2.5.4/src/bin/jp2/convert.c:2393:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2386:23: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2387:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2388:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2393:21: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 2391|                   if (!fread(&value, 1, 1, f)) {
# 2392|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2393|->                     opj_image_destroy(image);
# 2394|                       fclose(f);
# 2395|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
openjpeg-2.5.4/src/bin/jp2/convert.c:2393:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2386:23: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2387:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2388:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2393:21: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 2391|                   if (!fread(&value, 1, 1, f)) {
# 2392|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2393|->                     opj_image_destroy(image);
# 2394|                       fclose(f);
# 2395|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
openjpeg-2.5.4/src/bin/jp2/convert.c:2410:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_true: following ‘true’ branch...
 branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2402:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2403:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2410:21: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
# 2408|                   if (!fread(&temp1, 1, 1, f)) {
# 2409|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2410|->                     opj_image_destroy(image);
# 2411|                       fclose(f);
# 2412|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
openjpeg-2.5.4/src/bin/jp2/convert.c:2410:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_true: following ‘true’ branch...
 branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2402:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2403:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2410:21: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 2408|                   if (!fread(&temp1, 1, 1, f)) {
# 2409|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2410|->                     opj_image_destroy(image);
# 2411|                       fclose(f);
# 2412|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
openjpeg-2.5.4/src/bin/jp2/convert.c:2416:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_true: following ‘true’ branch...
 branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2402:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2403:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2408:20: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2414:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2416:21: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 2414|                   if (!fread(&temp2, 1, 1, f)) {
# 2415|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2416|->                     opj_image_destroy(image);
# 2417|                       fclose(f);
# 2418|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
openjpeg-2.5.4/src/bin/jp2/convert.c:2416:21: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_true: following ‘true’ branch...
 branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2402:26: branch_true: following ‘true’ branch (when ‘compno < numcomps’)...
openjpeg-2.5.4/src/bin/jp2/convert.c:2403:25: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2408:20: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2414:22: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2416:21: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 2414|                   if (!fread(&temp2, 1, 1, f)) {
# 2415|                       fprintf(stderr, "Error reading raw file. End of file probably reached.\n");
# 2416|->                     opj_image_destroy(image);
# 2417|                       fclose(f);
# 2418|                       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
openjpeg-2.5.4/src/bin/jp2/convert.c:2431:9: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2429:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2431:9: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 2429|           fprintf(stderr,
# 2430|                   "OpenJPEG cannot encode raw components with bit depth higher than 16 bits.\n");
# 2431|->         opj_image_destroy(image);
# 2432|           fclose(f);
# 2433|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
openjpeg-2.5.4/src/bin/jp2/convert.c:2431:9: 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)...
 branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2373:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2378:29: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2385:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2400:15: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convert.c:2429:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convert.c:2431:9: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 2429|           fprintf(stderr,
# 2430|                   "OpenJPEG cannot encode raw components with bit depth higher than 16 bits.\n");
# 2431|->         opj_image_destroy(image);
# 2432|           fclose(f);
# 2433|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: 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: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: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  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): [#def22]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:798:5: 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: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: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#  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): [#def23]
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: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: danger: ‘pData’ leaks here; was allocated at [(27)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/26)
#  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-775): [#def24]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:799:5: 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: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:799:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
#  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-401): [#def25]
openjpeg-2.5.4/src/bin/jp2/convertbmp.c:799:5: 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: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:799:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/1)
#  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-401): [#def26]
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: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: danger: ‘pData’ leaks here; was allocated at [(27)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/26)
#  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): [#def27]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:99:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(read_idf, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:243:14: enter_function: entry to ‘pngtoimage’
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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:274:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:274:13: call_function: calling ‘pngtoimage_internal’ from ‘pngtoimage’
#   97|           OPJ_INT32* row32s = NULL;
#   98|   
#   99|->         png_init_io(png, reader);
#  100|           png_set_sig_bytes(png, MAGIC_SIZE);
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(read_idf, "rb")’
openjpeg-2.5.4/src/bin/jp2/convertpng.c:243:14: enter_function: entry to ‘pngtoimage’
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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:274:13: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:274:13: call_function: calling ‘pngtoimage_internal’ from ‘pngtoimage’
#   97|           OPJ_INT32* row32s = NULL;
#   98|   
#   99|->         png_init_io(png, reader);
#  100|           png_set_sig_bytes(png, MAGIC_SIZE);
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266: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: danger: ‘fopen(read_idf, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  264|       }
#  265|   
#  266|->     if ((png = png_create_read_struct(PNG_LIBPNG_VER_STRING,
#  267|                                         NULL, NULL, NULL)) == NULL) {
#  268|           goto fin;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:266: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: danger: ‘fopen(read_idf, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  264|       }
#  265|   
#  266|->     if ((png = png_create_read_struct(PNG_LIBPNG_VER_STRING,
#  267|                                         NULL, NULL, NULL)) == NULL) {
#  268|           goto fin;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: 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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: danger: ‘fopen(read_idf, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  268|           goto fin;
#  269|       }
#  270|->     if ((info = png_create_info_struct(png)) == NULL) {
#  271|           goto fin;
#  272|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: 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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: danger: ‘fopen(read_idf, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  268|           goto fin;
#  269|       }
#  270|->     if ((info = png_create_info_struct(png)) == NULL) {
#  271|           goto fin;
#  272|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: 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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:271:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:276:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:283:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:283:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:286:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:286:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: danger: ‘fopen(read_idf, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  285|       }
#  286|       if (png) {
#  287|->         png_destroy_read_struct(&png, &info, NULL);
#  288|       }
#  289|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: 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:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:17: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:270:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:271:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:276:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:283:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:283:8: branch_false: following ‘false’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:286:9: branch_false: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:286:8: branch_true: following ‘true’ branch...
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: branch_true: ...to here
openjpeg-2.5.4/src/bin/jp2/convertpng.c:287:9: danger: ‘fopen(read_idf, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  285|       }
#  286|       if (png) {
#  287|->         png_destroy_read_struct(&png, &info, NULL);
#  288|       }
#  289|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:396:9: 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’)...
 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:396:9: danger: ‘fopen(write_idf, "wb")’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  394|       writer = fopen(write_idf, "wb");
#  395|   
#  396|->     if (writer == NULL) {
#  397|           return fails;
#  398|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:396:9: 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’)...
 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:396:9: danger: ‘fopen(write_idf, "wb")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  394|       writer = fopen(write_idf, "wb");
#  395|   
#  396|->     if (writer == NULL) {
#  397|           return fails;
#  398|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
openjpeg-2.5.4/src/bin/jp2/convertpng.c:485:13: 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’)...
 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: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:13: danger: ‘malloc(png_get_rowbytes(png,  info))’ leaks here; was allocated at [(20)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/19)
#  483|           }
#  484|           row_buf = (png_bytep)malloc(png_row_size);
#  485|->         if (row_buf == NULL) {
#  486|               fprintf(stderr, "Can't allocate memory for PNG row\n");
#  487|               goto fin;

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
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’)...
 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: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: CPPCHECK_WARNING (CWE-190): [#def40]
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): [#def41]
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): [#def42]
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): [#def43]
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): [#def44]
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): [#def45]
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): [#def46]
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): [#def47]
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): [#def48]
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): [#def49]
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): [#def50]
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): [#def51]
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): [#def52]
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): [#def53]
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): [#def54]
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): [#def55]
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): [#def56]
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): [#def57]
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): [#def58]
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): [#def59]
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): [#def60]
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): [#def61]
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): [#def62]
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): [#def63]
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): [#def64]
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): [#def65]
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): [#def66]
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): [#def67]
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): [#def68]
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): [#def69]
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): [#def70]
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): [#def71]
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): [#def72]
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): [#def73]
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): [#def74]
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): [#def75]
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): [#def76]
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): [#def77]
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): [#def78]
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): [#def79]
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): [#def80]
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): [#def81]
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): [#def82]
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): [#def83]
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): [#def84]
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): [#def85]
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): [#def86]
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): [#def87]
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: CPPCHECK_WARNING (CWE-476): [#def88]
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-775): [#def89]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def90]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def91]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def92]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def93]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def94]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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: [#def95]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def96]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def97]
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:1919:5: enter_function: entry to ‘main’
openjpeg-2.5.4/src/bin/jp2/opj_compress.c:1970:9: call_function: calling ‘parse_cmdline_encoder’ from ‘main’
# 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): [#def98]
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...
 branch_false: ...to here
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): [#def99]
openjpeg-2.5.4/src/bin/jp2/opj_decompress.c:425:23: 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: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  423|       }
#  424|   
#  425|->     while ((content = readdir(dir)) != NULL) {
#  426|           if (strcmp(".", content->d_name) == 0 || strcmp("..", content->d_name) == 0) {
#  427|               continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def100]
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
#argument 2 of ‘__builtin_strcpy’ must be non-null
#  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): [#def101]
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: 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): [#def102]
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): [#def103]
openjpeg-2.5.4/src/bin/jp2/opj_dump.c:173:23: 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: danger: ‘opendir(imgdirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  171|       }
#  172|   
#  173|->     while ((content = readdir(dir)) != NULL) {
#  174|           if (strcmp(".", content->d_name) == 0 || strcmp("..", content->d_name) == 0) {
#  175|               continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def104]
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
#argument 2 of ‘__builtin_strcpy’ must be non-null
#  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): [#def105]
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: GCC_ANALYZER_WARNING (CWE-476): [#def106]
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:4855:8: branch_false: following ‘false’ branch (when ‘total_data_size > 3’)...
openjpeg-2.5.4/src/lib/openjp2/j2k.c:4861:5: branch_false: ...to here
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): [#def107]
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: 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): [#def108]
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: 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): [#def109]
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: 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): [#def110]
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: 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));

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
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-13.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-gcc-latest-x86_64
project-nameopenjpeg-2.5.4-1.fc44
store-results-to/tmp/tmpr7ddtrxd/openjpeg-2.5.4-1.fc44.tar.xz
time-created2025-10-28 19:30:53
time-finished2025-10-28 19:33:42
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpr7ddtrxd/openjpeg-2.5.4-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpr7ddtrxd/openjpeg-2.5.4-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9