diff options
author | Marvin Scholz <epirat07@gmail.com> | 2020-05-12 09:52:05 +0300 |
---|---|---|
committer | Marvin Scholz <epirat07@gmail.com> | 2020-05-15 13:50:55 +0300 |
commit | d3a10dc8651273ec810f35a2f79ddbe06950ecbc (patch) | |
tree | 44dc6aac8a8457983372f494bed0a972bc39c1fa /tools | |
parent | e4a4c8c60b21d226f24cc315af30cb7f1591b29b (diff) |
tools: add missing fopen error handling
Diffstat (limited to 'tools')
-rw-r--r-- | tools/input/input.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/input/input.c b/tools/input/input.c index d8a56c1..3ed6983 100644 --- a/tools/input/input.c +++ b/tools/input/input.c @@ -82,6 +82,10 @@ int input_open(DemuxerContext **const c_out, return DAV1D_ERR(ENOMEM); } FILE *f = fopen(filename, "rb"); + if (!f) { + fprintf(stderr, "Failed to open input file %s: %s\n", filename, strerror(errno)); + return errno ? DAV1D_ERR(errno) : DAV1D_ERR(EIO); + } res = !!fread(probe_data, 1, probe_sz, f); fclose(f); if (!res) { |