summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/context.h2
-rw-r--r--source/fitz/memory.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index ba4255e3..0c0ee78f 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -87,7 +87,7 @@ void fz_rethrow_if(fz_context *ctx, int errcode);
enum
{
FZ_ERROR_NONE = 0,
- FZ_ERROR_OOM = 1,
+ FZ_ERROR_MEMORY = 1,
FZ_ERROR_GENERIC = 2,
FZ_ERROR_SYNTAX = 3,
FZ_ERROR_TRYLATER = 4,
diff --git a/source/fitz/memory.c b/source/fitz/memory.c
index 4a498e44..870ec973 100644
--- a/source/fitz/memory.c
+++ b/source/fitz/memory.c
@@ -56,7 +56,7 @@ fz_malloc(fz_context *ctx, size_t size)
p = do_scavenging_malloc(ctx, size);
if (!p)
- fz_throw(ctx, FZ_ERROR_OOM, "malloc of " FMT_zu " bytes failed", size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of " FMT_zu " bytes failed", size);
return p;
}
@@ -75,11 +75,11 @@ fz_malloc_array(fz_context *ctx, size_t count, size_t size)
return 0;
if (count > SIZE_MAX / size)
- fz_throw(ctx, FZ_ERROR_OOM, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
p = do_scavenging_malloc(ctx, count * size);
if (!p)
- fz_throw(ctx, FZ_ERROR_OOM, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
return p;
}
@@ -108,13 +108,13 @@ fz_calloc(fz_context *ctx, size_t count, size_t size)
if (count > SIZE_MAX / size)
{
- fz_throw(ctx, FZ_ERROR_OOM, "calloc (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
}
p = do_scavenging_malloc(ctx, count * size);
if (!p)
{
- fz_throw(ctx, FZ_ERROR_OOM, "calloc (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
}
memset(p, 0, count*size);
return p;
@@ -154,11 +154,11 @@ fz_resize_array(fz_context *ctx, void *p, size_t count, size_t size)
}
if (count > SIZE_MAX / size)
- fz_throw(ctx, FZ_ERROR_OOM, "resize array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
np = do_scavenging_realloc(ctx, p, count * size);
if (!np)
- fz_throw(ctx, FZ_ERROR_OOM, "resize array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
return np;
}