diff options
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) { |