libavif-1.3.0-3.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libavif-1.3.0/apps/avifenc.c:296:9: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1430:5: enter_function: entry to ‘main’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1518:13: call_function: calling ‘syntaxLong’ from ‘main’
#  294|       printf("    -a,--advanced KEY[=VALUE]         : Pass an advanced, codec-specific key/value string pair directly to the codec. avifenc will warn on any not used by the codec.\n");
#  295|       printf("\n");
#  296|->     if (avifCodecName(AVIF_CODEC_CHOICE_AOM, 0)) {
#  297|           printf("aom-specific advanced options:\n");
#  298|           printf("    1. <key>=<value> applies to both the color (YUV) planes and the alpha plane (if present).\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libavif-1.3.0/apps/avifenc.c:318:5: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1430:5: enter_function: entry to ‘main’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1518:13: call_function: calling ‘syntaxLong’ from ‘main’
#  316|           printf("\n");
#  317|       }
#  318|->     avifPrintVersions();
#  319|   }
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libavif-1.3.0/apps/avifenc.c:1522:13: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1522:13: throw: if ‘avifPrintVersions’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1522:13: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1520|               goto cleanup;
# 1521|           } else if (!strcmp(arg, "-V") || !strcmp(arg, "--version")) {
# 1522|->             avifPrintVersions();
# 1523|               returnCode = 0;
# 1524|               goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libavif-1.3.0/apps/avifenc.c:1530:33: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1528:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1529:16: branch_true: following ‘true’ branch (when the strings are equal)...
libavif-1.3.0/apps/avifenc.c:1530:33: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1530:33: throw: if ‘avifQueryCPUCount’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1530:33: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1528|               NEXTARG();
# 1529|               if (!strcmp(arg, "all")) {
# 1530|->                 settings.jobs = avifQueryCPUCount();
# 1531|               } else {
# 1532|                   settings.jobs = atoi(arg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libavif-1.3.0/apps/avifenc.c:1837:18: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1527:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1537:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1568:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1568:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1575:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1582:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1596:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1599:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1619:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1637:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1655:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1673:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1691:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1709:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1715:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1715:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1733:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1751:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1761:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1767:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1767:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1773:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1773:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1789:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1801:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1812:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1822:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1835:19: branch_true: following ‘true’ branch (when the strings are equal)...
libavif-1.3.0/apps/avifenc.c:1836:13: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1836:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1837:18: throw: if ‘avifReadEntireFile’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1837:18: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1835|           } else if (!strcmp(arg, "--exif")) {
# 1836|               NEXTARG();
# 1837|->             if (!avifReadEntireFile(arg, &exifOverride)) {
# 1838|                   fprintf(stderr, "ERROR: Unable to read Exif metadata: %s\n", arg);
# 1839|                   goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libavif-1.3.0/apps/avifenc.c:1844:18: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1527:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1537:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1568:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1568:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1575:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1582:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1596:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1599:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1619:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1637:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1655:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1673:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1691:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1709:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1715:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1715:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1733:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1751:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1761:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1767:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1767:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1773:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1773:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1789:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1801:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1812:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1822:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1835:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1842:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1842:19: branch_true: following ‘true’ branch (when the strings are equal)...
libavif-1.3.0/apps/avifenc.c:1843:13: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1843:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1844:18: throw: if ‘avifReadEntireFile’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1844:18: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1842|           } else if (!strcmp(arg, "--xmp")) {
# 1843|               NEXTARG();
# 1844|->             if (!avifReadEntireFile(arg, &xmpOverride)) {
# 1845|                   fprintf(stderr, "ERROR: Unable to read XMP metadata: %s\n", arg);
# 1846|                   goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libavif-1.3.0/apps/avifenc.c:1851:18: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1527:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1537:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1568:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1568:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1575:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1582:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1596:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1599:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1619:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1637:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1655:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1673:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1691:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1709:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1715:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1715:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1733:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1751:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1761:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1767:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1767:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1773:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1773:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1789:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1801:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1812:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1822:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1835:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1842:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1842:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1849:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1849:19: branch_true: following ‘true’ branch (when the strings are equal)...
libavif-1.3.0/apps/avifenc.c:1850:13: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1850:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1851:18: throw: if ‘avifReadEntireFile’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1851:18: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1849|           } else if (!strcmp(arg, "--icc")) {
# 1850|               NEXTARG();
# 1851|->             if (!avifReadEntireFile(arg, &iccOverride)) {
# 1852|                   fprintf(stderr, "ERROR: Unable to read ICC profile: %s\n", arg);
# 1853|                   goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libavif-1.3.0/apps/avifenc.c:1879:36: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1527:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1537:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1568:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1568:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1575:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1582:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1596:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1599:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1619:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1637:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1655:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1673:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1691:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1709:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1715:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1715:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1733:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1751:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1761:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1767:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1767:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1773:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1773:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1789:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1801:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1812:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1822:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1835:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1842:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1842:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1849:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1849:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1856:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1856:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1869:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1878:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1879:36: throw: if ‘avifCodecChoiceFromName’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1879:36: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1877|           } else if (!strcmp(arg, "-c") || !strcmp(arg, "--codec")) {
# 1878|               NEXTARG();
# 1879|->             settings.codecChoice = avifCodecChoiceFromName(arg);
# 1880|               if (settings.codecChoice == AVIF_CODEC_CHOICE_AUTO) {
# 1881|                   fprintf(stderr, "ERROR: Unrecognized codec: %s\n", arg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libavif-1.3.0/apps/avifenc.c:1884:42: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1517:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1521:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1527:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1537:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1568:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1568:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1575:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1582:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1596:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1599:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1619:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1637:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1655:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1673:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1691:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1709:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1715:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1715:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1733:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1751:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1761:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1767:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1767:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1773:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1773:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1789:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1801:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1812:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1822:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1835:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1842:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1842:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1849:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1849:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1856:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1856:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1869:19: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1878:13: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1880:16: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1884:42: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1884:42: throw: if ‘avifCodecName’ throws an exception...
libavif-1.3.0/apps/avifenc.c:1884:42: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1882|                   goto cleanup;
# 1883|               } else {
# 1884|->                 const char * codecName = avifCodecName(settings.codecChoice, AVIF_CODEC_FLAG_CAN_ENCODE);
# 1885|                   if (codecName == NULL) {
# 1886|                       fprintf(stderr, "ERROR: Codec cannot encode: %s\n", arg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libavif-1.3.0/apps/avifenc.c:2005:25: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1511:20: branch_false: following ‘false’ branch (when ‘argIndex >= argc’)...
libavif-1.3.0/apps/avifenc.c:1996:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1996:21: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:2004:9: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2004:8: branch_true: following ‘true’ branch...
libavif-1.3.0/apps/avifenc.c:2005:25: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:2005:25: throw: if ‘avifQueryCPUCount’ throws an exception...
libavif-1.3.0/apps/avifenc.c:2005:25: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 2003|   
# 2004|       if (settings.jobs == -1) {
# 2005|->         settings.jobs = avifQueryCPUCount();
# 2006|       }
# 2007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libavif-1.3.0/apps/avifenc.c:2658:5: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2645:8: branch_false: following ‘false’ branch (when ‘gridCells’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: following ‘false’ branch (when ‘image’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: following ‘false’ branch (when ‘gridSplitImage’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2658:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2658:5: throw: if ‘avifRWDataFree’ throws an exception...
libavif-1.3.0/apps/avifenc.c:2658:5: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 2656|           avifImageDestroy(gridSplitImage);
# 2657|       }
# 2658|->     avifRWDataFree(&raw);
# 2659|       avifRWDataFree(&exifOverride);
# 2660|       avifRWDataFree(&xmpOverride);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libavif-1.3.0/apps/avifenc.c:2659:5: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2645:8: branch_false: following ‘false’ branch (when ‘gridCells’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: following ‘false’ branch (when ‘image’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: following ‘false’ branch (when ‘gridSplitImage’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2658:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2659:5: throw: if ‘avifRWDataFree’ throws an exception...
libavif-1.3.0/apps/avifenc.c:2659:5: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 2657|       }
# 2658|       avifRWDataFree(&raw);
# 2659|->     avifRWDataFree(&exifOverride);
# 2660|       avifRWDataFree(&xmpOverride);
# 2661|       avifRWDataFree(&iccOverride);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libavif-1.3.0/apps/avifenc.c:2660:5: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2645:8: branch_false: following ‘false’ branch (when ‘gridCells’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: following ‘false’ branch (when ‘image’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: following ‘false’ branch (when ‘gridSplitImage’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2658:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2660:5: throw: if ‘avifRWDataFree’ throws an exception...
libavif-1.3.0/apps/avifenc.c:2660:5: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
# 2658|       avifRWDataFree(&raw);
# 2659|       avifRWDataFree(&exifOverride);
# 2660|->     avifRWDataFree(&xmpOverride);
# 2661|       avifRWDataFree(&iccOverride);
# 2662|       avifCodecSpecificOptionsFree(&pendingSettings.codecSpecificOptions);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libavif-1.3.0/apps/avifenc.c:2661:5: warning[-Wanalyzer-malloc-leak]: leak of ‘input.files’
libavif-1.3.0/apps/avifenc.c:1432:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libavif-1.3.0/apps/avifenc.c:1440:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1441:19: acquire_memory: allocated here
libavif-1.3.0/apps/avifenc.c:1442:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/avifenc.c:1454:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:1504:12: branch_true: following ‘true’ branch (when ‘argIndex < argc’)...
libavif-1.3.0/apps/avifenc.c:1505:32: branch_true: ...to here
libavif-1.3.0/apps/avifenc.c:1507:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libavif-1.3.0/apps/avifenc.c:1517:21: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2645:8: branch_false: following ‘false’ branch (when ‘gridCells’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2652:15: branch_false: following ‘false’ branch (when ‘image’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2655:8: branch_false: following ‘false’ branch (when ‘gridSplitImage’ is NULL)...
libavif-1.3.0/apps/avifenc.c:2658:5: branch_false: ...to here
libavif-1.3.0/apps/avifenc.c:2661:5: throw: if ‘avifRWDataFree’ throws an exception...
libavif-1.3.0/apps/avifenc.c:2661:5: danger: ‘input.files’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 2659|       avifRWDataFree(&exifOverride);
# 2660|       avifRWDataFree(&xmpOverride);
# 2661|->     avifRWDataFree(&iccOverride);
# 2662|       avifCodecSpecificOptionsFree(&pendingSettings.codecSpecificOptions);
# 2663|       while (input.cacheCount) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
libavif-1.3.0/apps/shared/avifjpeg.c:890:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(inputFilename, "rb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1242:10: enter_function: entry to ‘avifJPEGRead’
libavif-1.3.0/apps/shared/avifjpeg.c:1253:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifjpeg.c:1254:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: call_function: calling ‘avifJPEGReadInternal’ from ‘avifJPEGRead’
#  888|       struct my_error_mgr jerr;
#  889|       struct jpeg_decompress_struct cinfo;
#  890|->     cinfo.err = jpeg_std_error(&jerr.pub);
#  891|       jerr.pub.error_exit = my_error_exit;
#  892|       if (setjmp(jerr.setjmp_buffer)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libavif-1.3.0/apps/shared/avifjpeg.c:890:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(inputFilename, "rb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1242:10: enter_function: entry to ‘avifJPEGRead’
libavif-1.3.0/apps/shared/avifjpeg.c:1253:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifjpeg.c:1254:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: call_function: calling ‘avifJPEGReadInternal’ from ‘avifJPEGRead’
#  888|       struct my_error_mgr jerr;
#  889|       struct jpeg_decompress_struct cinfo;
#  890|->     cinfo.err = jpeg_std_error(&jerr.pub);
#  891|       jerr.pub.error_exit = my_error_exit;
#  892|       if (setjmp(jerr.setjmp_buffer)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
libavif-1.3.0/apps/shared/avifjpeg.c:899:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(inputFilename, "rb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1242:10: enter_function: entry to ‘avifJPEGRead’
libavif-1.3.0/apps/shared/avifjpeg.c:1253:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifjpeg.c:1254:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: call_function: calling ‘avifJPEGReadInternal’ from ‘avifJPEGRead’
#  897|   
#  898|       // See also https://exiftool.org/TagNames/JPEG.html for the meaning of various APP<n> segments.
#  899|->     if (!ignoreExif || !ignoreXMP || !ignoreGainMap) {
#  900|           // Keep APP1 blocks, for Exif and XMP.
#  901|           jpeg_save_markers(&cinfo, JPEG_APP0 + 1, /*length_limit=*/0xFFFF);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libavif-1.3.0/apps/shared/avifjpeg.c:899:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(inputFilename, "rb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1242:10: enter_function: entry to ‘avifJPEGRead’
libavif-1.3.0/apps/shared/avifjpeg.c:1253:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifjpeg.c:1254:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1258:26: call_function: calling ‘avifJPEGReadInternal’ from ‘avifJPEGRead’
#  897|   
#  898|       // See also https://exiftool.org/TagNames/JPEG.html for the meaning of various APP<n> segments.
#  899|->     if (!ignoreExif || !ignoreXMP || !ignoreGainMap) {
#  900|           // Keep APP1 blocks, for Exif and XMP.
#  901|           jpeg_save_markers(&cinfo, JPEG_APP0 + 1, /*length_limit=*/0xFFFF);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1289:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1293:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1293:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1298:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1298:9: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifjpeg.c:1299:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: throw: if ‘jpeg_stdio_dest’ throws an exception...
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: danger: ‘fopen(outputFilename, "wb")’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1302|       }
# 1303|   
# 1304|->     jpeg_stdio_dest(&cinfo, f);
# 1305|       cinfo.image_width = avif->width;
# 1306|       cinfo.image_height = avif->height;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/avifjpeg.c:1289:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1293:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1293:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1298:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1298:9: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifjpeg.c:1299:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: throw: if ‘jpeg_stdio_dest’ throws an exception...
libavif-1.3.0/apps/shared/avifjpeg.c:1304:5: danger: ‘fopen(outputFilename, "wb")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1302|       }
# 1303|   
# 1304|->     jpeg_stdio_dest(&cinfo, f);
# 1305|       cinfo.image_width = avif->width;
# 1306|       cinfo.image_height = avif->height;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
libavif-1.3.0/apps/shared/avifpng.c:259:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:9: throw: if ‘png_sig_cmp’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:259:9: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  257|           goto cleanup;
#  258|       }
#  259|->     if (png_sig_cmp(header, 0, 8)) {
#  260|           fprintf(stderr, "Not a PNG: %s\n", inputFilename);
#  261|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libavif-1.3.0/apps/shared/avifpng.c:259:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:9: throw: if ‘png_sig_cmp’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:259:9: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  257|           goto cleanup;
#  258|       }
#  259|->     if (png_sig_cmp(header, 0, 8)) {
#  260|           fprintf(stderr, "Not a PNG: %s\n", inputFilename);
#  261|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
libavif-1.3.0/apps/shared/avifpng.c:264:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:264:11: throw: if ‘png_create_read_struct’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:264:11: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  262|       }
#  263|   
#  264|->     png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
#  265|       if (!png) {
#  266|           fprintf(stderr, "Cannot init libpng (png): %s\n", inputFilename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libavif-1.3.0/apps/shared/avifpng.c:264:11: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:264:11: throw: if ‘png_create_read_struct’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:264:11: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  262|       }
#  263|   
#  264|->     png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
#  265|       if (!png) {
#  266|           fprintf(stderr, "Cannot init libpng (png): %s\n", inputFilename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
libavif-1.3.0/apps/shared/avifpng.c:269:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:265:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:269:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:269:12: throw: if ‘png_create_info_struct’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:269:12: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  267|           goto cleanup;
#  268|       }
#  269|->     info = png_create_info_struct(png);
#  270|       if (!info) {
#  271|           fprintf(stderr, "Cannot init libpng (info): %s\n", inputFilename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libavif-1.3.0/apps/shared/avifpng.c:269:12: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:265:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:269:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:269:12: throw: if ‘png_create_info_struct’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:269:12: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  267|           goto cleanup;
#  268|       }
#  269|->     info = png_create_info_struct(png);
#  270|       if (!info) {
#  271|           fprintf(stderr, "Cannot init libpng (info): %s\n", inputFilename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
libavif-1.3.0/apps/shared/avifpng.c:280:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:265:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:269:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:270:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:275:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:275:9: setjmp: ‘setjmp’ called here
libavif-1.3.0/apps/shared/avifpng.c:275:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:280:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:280:5: throw: if ‘png_init_io’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:280:5: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  278|       }
#  279|   
#  280|->     png_init_io(png, f);
#  281|       png_set_sig_bytes(png, 8);
#  282|       png_read_info(png, info);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libavif-1.3.0/apps/shared/avifpng.c:280:5: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
libavif-1.3.0/apps/shared/avifpng.c:247:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:248:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:254:24: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:255:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:259:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:259:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:264:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:265:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:269:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:270:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:275:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:275:9: setjmp: ‘setjmp’ called here
libavif-1.3.0/apps/shared/avifpng.c:275:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:280:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:280:5: throw: if ‘png_init_io’ throws an exception...
libavif-1.3.0/apps/shared/avifpng.c:280:5: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  278|       }
#  279|   
#  280|->     png_init_io(png, f);
#  281|       png_set_sig_bytes(png, 8);
#  282|       png_read_info(png, info);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
libavif-1.3.0/apps/shared/avifpng.c:600:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/avifpng.c:550:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:554:8: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:600:9: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifpng.c:600:5: danger: ‘fopen(outputFilename, "wb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  598|       }
#  599|   
#  600|->     f = fopen(outputFilename, "wb");
#  601|       if (!f) {
#  602|           fprintf(stderr, "Can't open PNG file for write: %s\n", outputFilename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libavif-1.3.0/apps/shared/avifpng.c:600:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/avifpng.c:550:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:554:8: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:600:9: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:600:5: danger: ‘fopen(outputFilename, "wb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  598|       }
#  599|   
#  600|->     f = fopen(outputFilename, "wb");
#  601|       if (!f) {
#  602|           fprintf(stderr, "Can't open PNG file for write: %s\n", outputFilename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libavif-1.3.0/apps/shared/avifpng.c:724:5: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)*avif.height * 8)’
libavif-1.3.0/apps/shared/avifpng.c:550:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:554:8: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:601:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:606:11: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:607:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:611:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:612:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:617:9: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:617:9: setjmp: ‘setjmp’ called here
libavif-1.3.0/apps/shared/avifpng.c:617:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifpng.c:622:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifpng.c:724:32: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifpng.c:724:5: danger: ‘malloc((long unsigned int)*avif.height * 8)’ leaks here; was allocated at [(12)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/11)
#  722|       }
#  723|   
#  724|->     rowPointers = (png_bytep *)malloc(sizeof(png_bytep) * avif->height);
#  725|       if (rowPointers == NULL) {
#  726|           fprintf(stderr, "Error writing PNG: memory allocation failure");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
libavif-1.3.0/apps/shared/avifutil.c:346:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:346:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:346:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  344|       }
#  345|   
#  346|->     fseek(f, 0, SEEK_END);
#  347|       long pos = ftell(f);
#  348|       if (pos <= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libavif-1.3.0/apps/shared/avifutil.c:346:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:346:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:346:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  344|       }
#  345|   
#  346|->     fseek(f, 0, SEEK_END);
#  347|       long pos = ftell(f);
#  348|       if (pos <= 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
libavif-1.3.0/apps/shared/avifutil.c:347:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:347:16: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:347:16: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  345|   
#  346|       fseek(f, 0, SEEK_END);
#  347|->     long pos = ftell(f);
#  348|       if (pos <= 0) {
#  349|           fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libavif-1.3.0/apps/shared/avifutil.c:347:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:347:16: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:347:16: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  345|   
#  346|       fseek(f, 0, SEEK_END);
#  347|->     long pos = ftell(f);
#  348|       if (pos <= 0) {
#  349|           fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
libavif-1.3.0/apps/shared/avifutil.c:353:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:348:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:352:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:353:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:353:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  351|       }
#  352|       size_t fileSize = (size_t)pos;
#  353|->     fseek(f, 0, SEEK_SET);
#  354|   
#  355|       if (avifRWDataRealloc(raw, fileSize) != AVIF_RESULT_OK) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libavif-1.3.0/apps/shared/avifutil.c:353:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:348:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:352:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:353:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:353:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  351|       }
#  352|       size_t fileSize = (size_t)pos;
#  353|->     fseek(f, 0, SEEK_SET);
#  354|   
#  355|       if (avifRWDataRealloc(raw, fileSize) != AVIF_RESULT_OK) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
libavif-1.3.0/apps/shared/avifutil.c:355:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:348:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:352:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:355:9: throw: if ‘avifRWDataRealloc’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:355:9: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  353|       fseek(f, 0, SEEK_SET);
#  354|   
#  355|->     if (avifRWDataRealloc(raw, fileSize) != AVIF_RESULT_OK) {
#  356|           fclose(f);
#  357|           return AVIF_FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libavif-1.3.0/apps/shared/avifutil.c:355:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/apps/shared/avifutil.c:341:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/avifutil.c:342:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:346:5: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:348:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/avifutil.c:352:12: branch_false: ...to here
libavif-1.3.0/apps/shared/avifutil.c:355:9: throw: if ‘avifRWDataRealloc’ throws an exception...
libavif-1.3.0/apps/shared/avifutil.c:355:9: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  353|       fseek(f, 0, SEEK_SET);
#  354|   
#  355|->     if (avifRWDataRealloc(raw, fileSize) != AVIF_RESULT_OK) {
#  356|           fclose(f);
#  357|           return AVIF_FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
libavif-1.3.0/apps/shared/y4m.c:595:83: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/y4m.c:588:16: acquire_resource: opened here
libavif-1.3.0/apps/shared/y4m.c:589:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/y4m.c:595:83: branch_false: ...to here
libavif-1.3.0/apps/shared/y4m.c:595:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/y4m.c:601:27: branch_false: ...to here
libavif-1.3.0/apps/shared/y4m.c:602:35: branch_true: following ‘true’ branch (when ‘lastPlane >= plane’)...
libavif-1.3.0/apps/shared/y4m.c:603:32: branch_true: ...to here
libavif-1.3.0/apps/shared/y4m.c:603:32: throw: if ‘avifImagePlaneHeight’ throws an exception...
libavif-1.3.0/apps/shared/y4m.c:595:83: danger: ‘fopen(outputFilename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  593|   
#  594|       avifBool success = AVIF_TRUE;
#  595|->     if (fprintf(f, "YUV4MPEG2 W%d H%d F25:1 Ip A0:0 %s %s\nFRAME\n", avif->width, avif->height, y4mHeaderFormat, rangeString) < 0) {
#  596|           fprintf(stderr, "Cannot write to file: %s\n", outputFilename);
#  597|           success = AVIF_FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libavif-1.3.0/apps/shared/y4m.c:595:83: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outputFilename, "wb")’
libavif-1.3.0/apps/shared/y4m.c:588:16: acquire_memory: allocated here
libavif-1.3.0/apps/shared/y4m.c:589:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/y4m.c:595:83: branch_false: ...to here
libavif-1.3.0/apps/shared/y4m.c:595:8: branch_false: following ‘false’ branch...
libavif-1.3.0/apps/shared/y4m.c:601:27: branch_false: ...to here
libavif-1.3.0/apps/shared/y4m.c:602:35: branch_true: following ‘true’ branch (when ‘lastPlane >= plane’)...
libavif-1.3.0/apps/shared/y4m.c:603:32: branch_true: ...to here
libavif-1.3.0/apps/shared/y4m.c:603:32: throw: if ‘avifImagePlaneHeight’ throws an exception...
libavif-1.3.0/apps/shared/y4m.c:595:83: danger: ‘fopen(outputFilename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  593|   
#  594|       avifBool success = AVIF_TRUE;
#  595|->     if (fprintf(f, "YUV4MPEG2 W%d H%d F25:1 Ip A0:0 %s %s\nFRAME\n", avif->width, avif->height, y4mHeaderFormat, rangeString) < 0) {
#  596|           fprintf(stderr, "Cannot write to file: %s\n", outputFilename);
#  597|           success = AVIF_FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
libavif-1.3.0/src/io.c:145:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_resource: opened here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:145:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/src/io.c:145:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  143|       }
#  144|   
#  145|->     fseek(f, 0, SEEK_END);
#  146|       long fileSize = ftell(f);
#  147|       if (fileSize < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
libavif-1.3.0/src/io.c:145:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_memory: allocated here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:145:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/src/io.c:145:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  143|       }
#  144|   
#  145|->     fseek(f, 0, SEEK_END);
#  146|       long fileSize = ftell(f);
#  147|       if (fileSize < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
libavif-1.3.0/src/io.c:146:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_resource: opened here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:146:21: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/src/io.c:146:21: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  144|   
#  145|       fseek(f, 0, SEEK_END);
#  146|->     long fileSize = ftell(f);
#  147|       if (fileSize < 0) {
#  148|           fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libavif-1.3.0/src/io.c:146:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_memory: allocated here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:146:21: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/src/io.c:146:21: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  144|   
#  145|       fseek(f, 0, SEEK_END);
#  146|->     long fileSize = ftell(f);
#  147|       if (fileSize < 0) {
#  148|           fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libavif-1.3.0/src/io.c:151:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_resource: opened here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:147:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:151:5: branch_false: ...to here
libavif-1.3.0/src/io.c:151:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/src/io.c:151:5: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  149|           return NULL;
#  150|       }
#  151|->     fseek(f, 0, SEEK_SET);
#  152|   
#  153|       avifIOFileReader * reader = (avifIOFileReader *)avifAlloc(sizeof(avifIOFileReader));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libavif-1.3.0/src/io.c:151:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_memory: allocated here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:147:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:151:5: branch_false: ...to here
libavif-1.3.0/src/io.c:151:5: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/src/io.c:151:5: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  149|           return NULL;
#  150|       }
#  151|->     fseek(f, 0, SEEK_SET);
#  152|   
#  153|       avifIOFileReader * reader = (avifIOFileReader *)avifAlloc(sizeof(avifIOFileReader));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
libavif-1.3.0/src/io.c:153:53: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_resource: opened here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:147:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:151:5: branch_false: ...to here
libavif-1.3.0/src/io.c:153:53: throw: if ‘avifAlloc’ throws an exception...
libavif-1.3.0/src/io.c:153:53: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  151|       fseek(f, 0, SEEK_SET);
#  152|   
#  153|->     avifIOFileReader * reader = (avifIOFileReader *)avifAlloc(sizeof(avifIOFileReader));
#  154|       if (!reader) {
#  155|           fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
libavif-1.3.0/src/io.c:153:53: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
libavif-1.3.0/src/io.c:140:16: acquire_memory: allocated here
libavif-1.3.0/src/io.c:141:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:145:5: branch_false: ...to here
libavif-1.3.0/src/io.c:147:8: branch_false: following ‘false’ branch...
libavif-1.3.0/src/io.c:151:5: branch_false: ...to here
libavif-1.3.0/src/io.c:153:53: throw: if ‘avifAlloc’ throws an exception...
libavif-1.3.0/src/io.c:153:53: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  151|       fseek(f, 0, SEEK_SET);
#  152|   
#  153|->     avifIOFileReader * reader = (avifIOFileReader *)avifAlloc(sizeof(avifIOFileReader));
#  154|       if (!reader) {
#  155|           fclose(f);

Error: COMPILER_WARNING: [#def50]
libavif-1.3.0/src/mem.c:12:12: warning[-Walloc-size-larger-than=]: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807
#   12 |     return malloc(size);
#      |            ^
/usr/include/stdlib.h: scope_hint: In member function ‘TestBody’
/usr/include/stdlib.h:676:14: note: in a call to allocation function ‘malloc’ declared here
#  676 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
#      |              ^
#   10|   {
#   11|       assert(size != 0); // Implementation-defined. See https://en.cppreference.com/w/cpp/memory/c/malloc
#   12|->     return malloc(size);
#   13|   }
#   14|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
libavif-1.3.0/src/read.c:201:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libavif-1.3.0/src/read.c:5850:19: enter_function: entry to ‘avifReadCodecConfigProperty’
libavif-1.3.0/src/read.c:5852:39: call_function: inlined call to ‘avifGetConfigurationPropertyName’ from ‘avifReadCodecConfigProperty’
libavif-1.3.0/src/read.c:5852:39: call_function: inlined call to ‘avifPropertyArrayFind’ from ‘avifReadCodecConfigProperty’
#  199|       for (uint32_t propertyIndex = 0; propertyIndex < properties->count; ++propertyIndex) {
#  200|           const avifProperty * prop = &properties->prop[propertyIndex];
#  201|->         if (!memcmp(prop->type, type, 4)) {
#  202|               return prop;
#  203|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libavif-1.3.0/tests/aviftest.c:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘nfd.dir’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
#   78|   
#   79|       struct dirent * entry;
#   80|->     while ((entry = readdir(nfd->dir)) != NULL) {
#   81|           const char * dot = strrchr(entry->d_name, '.');
#   82|           if (dot) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
libavif-1.3.0/tests/aviftest.c:202:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_resource: opened here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:202:9: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/tests/aviftest.c:202:9: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was opened at [(20)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/19)
#  200|               break;
#  201|           }
#  202|->         fseek(f, 0, SEEK_END);
#  203|           size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libavif-1.3.0/tests/aviftest.c:202:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_memory: allocated here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:202:9: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/tests/aviftest.c:202:9: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was allocated at [(20)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/19)
#  200|               break;
#  201|           }
#  202|->         fseek(f, 0, SEEK_END);
#  203|           size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
libavif-1.3.0/tests/aviftest.c:203:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_resource: opened here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:203:27: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/tests/aviftest.c:203:27: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was opened at [(20)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/19)
#  201|           }
#  202|           fseek(f, 0, SEEK_END);
#  203|->         size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);
#  205|           if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libavif-1.3.0/tests/aviftest.c:203:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_memory: allocated here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:203:27: throw: if ‘ftell’ throws an exception...
libavif-1.3.0/tests/aviftest.c:203:27: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was allocated at [(20)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/19)
#  201|           }
#  202|           fseek(f, 0, SEEK_END);
#  203|->         size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);
#  205|           if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
libavif-1.3.0/tests/aviftest.c:204:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_resource: opened here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:204:9: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/tests/aviftest.c:204:9: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was opened at [(20)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/19)
#  202|           fseek(f, 0, SEEK_END);
#  203|           size_t fileSize = ftell(f);
#  204|->         fseek(f, 0, SEEK_SET);
#  205|           if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {
#  206|               printf("Out of memory when allocating buffer to read file: %s\n", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libavif-1.3.0/tests/aviftest.c:204:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_memory: allocated here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:204:9: throw: if ‘fseek’ throws an exception...
libavif-1.3.0/tests/aviftest.c:204:9: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was allocated at [(20)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/19)
#  202|           fseek(f, 0, SEEK_END);
#  203|           size_t fileSize = ftell(f);
#  204|->         fseek(f, 0, SEEK_SET);
#  205|           if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {
#  206|               printf("Out of memory when allocating buffer to read file: %s\n", filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
libavif-1.3.0/tests/aviftest.c:205:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_resource: opened here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:205:13: throw: if ‘avifRWDataRealloc’ throws an exception...
libavif-1.3.0/tests/aviftest.c:205:13: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was opened at [(20)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/19)
#  203|           size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);
#  205|->         if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {
#  206|               printf("Out of memory when allocating buffer to read file: %s\n", filename);
#  207|               fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libavif-1.3.0/tests/aviftest.c:205:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fullFilename, "rb")’
libavif-1.3.0/tests/aviftest.c:161:12: enter_function: entry to ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:171:8: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:175:5: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:184:29: call_function: calling ‘nextFilename’ from ‘runIOTests’
libavif-1.3.0/tests/aviftest.c:184:29: return_function: returning to ‘runIOTests’ from ‘nextFilename’
libavif-1.3.0/tests/aviftest.c:185:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
libavif-1.3.0/tests/aviftest.c:187:30: branch_true: ...to here
libavif-1.3.0/tests/aviftest.c:188:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:193:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:196:20: acquire_memory: allocated here
libavif-1.3.0/tests/aviftest.c:197:12: branch_false: following ‘false’ branch...
libavif-1.3.0/tests/aviftest.c:202:9: branch_false: ...to here
libavif-1.3.0/tests/aviftest.c:205:13: throw: if ‘avifRWDataRealloc’ throws an exception...
libavif-1.3.0/tests/aviftest.c:205:13: danger: ‘fopen(&fullFilename, "rb")’ leaks here; was allocated at [(20)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/19)
#  203|           size_t fileSize = ftell(f);
#  204|           fseek(f, 0, SEEK_SET);
#  205|->         if (avifRWDataRealloc(&fileBuffer, fileSize) != AVIF_RESULT_OK) {
#  206|               printf("Out of memory when allocating buffer to read file: %s\n", filename);
#  207|               fclose(f);

Error: COMPILER_WARNING: [#def61]
libavif-1.3.0/tests/gtest/avifincrtest_helpers.cc: scope_hint: In function ‘void avif::testutil::{anonymous}::EncodeAsGrid(const avifImage&, uint32_t, uint32_t, avifRWData*, uint32_t*, uint32_t*)’
libavif-1.3.0/tests/gtest/avifincrtest_helpers.cc:214:26: warning[-Wunused-but-set-variable=]: variable ‘i_cell’ set but not used
#  214 |   for (uint32_t row = 0, i_cell = 0; row < grid_rows; ++row) {
#      |                          ^~~~~~
#  212|     std::vector<ImagePtr> cell_images;
#  213|     cell_images.reserve(grid_cols * grid_rows);
#  214|->   for (uint32_t row = 0, i_cell = 0; row < grid_rows; ++row) {
#  215|       for (uint32_t col = 0; col < grid_cols; ++col, ++i_cell) {
#  216|         avifCropRect cell;

Scan Properties

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