shithub: dav1d

Download patch

ref: d3a10dc8651273ec810f35a2f79ddbe06950ecbc
parent: e4a4c8c60b21d226f24cc315af30cb7f1591b29b
author: Marvin Scholz <epirat07@gmail.com>
date: Tue May 12 04:52:05 EDT 2020

tools: add missing fopen error handling

--- a/tools/input/input.c
+++ b/tools/input/input.c
@@ -82,6 +82,10 @@
             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) {