mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08: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:
1 parent
851a84650e
commit
8ded602eda
1 file changed
+6
-2
+6
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user