1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

ffbuild/bin2c: misc fix

close input file if open output fail/read errors.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao
2025-01-08 19:04:12 +08:00
committed by Jun Zhao
parent 851a84650e
commit 8ded602eda

View File

@@ -38,8 +38,10 @@ int main(int argc, char **argv)
return -1;
output = fopen(argv[2], "wb");
if (!output)
if (!output) {
fclose(input);
return -1;
}
if (argc == 4) {
name = argv[3];
@@ -67,8 +69,10 @@ int main(int argc, char **argv)
fclose(output);
if (ferror(input) || !feof(input))
if (ferror(input) || !feof(input)) {
fclose(input);
return -1;
}
fclose(input);