summaryrefslogtreecommitdiff
path: root/fitz/stm_open.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-11-15 15:21:45 +0000
committerRobin Watts <robin.watts@artifex.com>2011-11-15 15:21:45 +0000
commit6610ebcb477e204605a1a3dd95e89b03382ee760 (patch)
tree95d96f950b0a6b08a7aaf317e69052260b8b121c /fitz/stm_open.c
parent9c0a49060475b2dea1e4c2668bebd1d566113a7b (diff)
downloadmupdf-6610ebcb477e204605a1a3dd95e89b03382ee760.tar.xz
Error, don't crash on file not found.
Throw an error rather than returning NULL from fz_open_file.
Diffstat (limited to 'fitz/stm_open.c')
-rw-r--r--fitz/stm_open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fitz/stm_open.c b/fitz/stm_open.c
index 18079f4b..dfbc42ae 100644
--- a/fitz/stm_open.c
+++ b/fitz/stm_open.c
@@ -98,7 +98,7 @@ fz_open_file(fz_context *ctx, const char *name)
{
int fd = open(name, O_BINARY | O_RDONLY, 0);
if (fd == -1)
- return NULL;
+ fz_throw(ctx, "Failed to open %s", name);
return fz_open_fd(ctx, fd);
}