Commit d938556fc0 for aom
commit d938556fc0d1690134bae8e5e7b6a01e956a5b0d
Author: James Zern <jzern@google.com>
Date: Thu Jun 18 14:53:17 2026 -0700
aomdec: fix FILE leak on failure
Close `framestats_file` if the option was provided. This is a follow up
to: 58c8e14ddc aomdec: fix FILE leak on failure
Fixes some clang-19 static analysis warnings.
Bug: 474642915
Change-Id: I78203baed215de6ccb54d3dcb2b82e9d6473e360
diff --git a/apps/aomdec.c b/apps/aomdec.c
index 4d5999f2c2..3a8fbc3ee2 100644
--- a/apps/aomdec.c
+++ b/apps/aomdec.c
@@ -619,6 +619,7 @@ static int main_loop(int argc, const char **argv_) {
fprintf(stderr,
"Not dumping raw video to your terminal. Use '-o -' to "
"override.\n");
+ if (framestats_file) fclose(framestats_file);
free(argv);
return EXIT_FAILURE;
}
@@ -629,6 +630,7 @@ static int main_loop(int argc, const char **argv_) {
infile = using_file ? fopen(fn, "rb") : set_binary_mode(stdin);
if (!infile) {
+ if (framestats_file) fclose(framestats_file);
fatal("Failed to open input file '%s'", using_file ? fn : "stdin");
}
input.aom_input_ctx->filename = fn;