diff options
author | Ray Johnston <ray.johnston@artifex.com> | 2015-01-03 16:00:16 -0800 |
---|---|---|
committer | Ray Johnston <ray.johnston@artifex.com> | 2015-01-03 16:04:36 -0800 |
commit | 188c7b05a5c232ba43e6b3172023498f7aa72c70 (patch) | |
tree | 5411838e1d4f999df4b8b44a38564b8773909918 /xps/xpshash.c | |
parent | f553eec30efa8cbefdc3c3635e090abb915a1a9d (diff) | |
download | ghostpdl-188c7b05a5c232ba43e6b3172023498f7aa72c70.tar.gz |
Fix segfault with ppmraw -r300 from fts_06_0626.pdf.xpse when allocation fails
The gxps had numerous places where allocation failures were ignored,
writing to RAM at offsets from 0 (NULL). This no longer fails, but the
fixes are not yet complete. Running a memento build with the parameters:
MEMENTO_SQUEEZEAT=1 gxps -o /dev/null -sDEVICE=ppmraw in.xps
Diffstat (limited to 'xps/xpshash.c')
-rw-r--r-- | xps/xpshash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xps/xpshash.c b/xps/xpshash.c index 2acdd8c9f..cda0c55cf 100644 --- a/xps/xpshash.c +++ b/xps/xpshash.c @@ -70,7 +70,7 @@ xps_hash_new(xps_context_t *ctx) table = xps_alloc(ctx, sizeof(xps_hash_table_t)); if (!table) { - gs_throw(-1, "out of memory: hash table struct"); + gs_throw(gs_error_VMerror, "out of memory: hash table struct"); return NULL; } @@ -81,7 +81,7 @@ xps_hash_new(xps_context_t *ctx) if (!table->entries) { xps_free(ctx, table); - gs_throw(-1, "out of memory: hash table entries array"); + gs_throw(gs_error_VMerror, "out of memory: hash table entries array"); return NULL; } @@ -111,7 +111,7 @@ xps_hash_double(xps_context_t *ctx, xps_hash_table_t *table) old_entries = table->entries; new_entries = xps_alloc(ctx, sizeof(xps_hash_entry_t) * new_size); if (!new_entries) - return gs_throw(-1, "out of memory: hash table entries array"); + return gs_throw(gs_error_VMerror, "out of memory: hash table entries array"); table->size = new_size; table->entries = new_entries; |