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 4d5999f..3a8fbc3 100644 --- a/apps/aomdec.c +++ b/apps/aomdec.c
@@ -619,6 +619,7 @@ 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 @@ 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;