summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jbig2dec/jbig2_symbol_dict.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
index 672425d98..164294d62 100644
--- a/jbig2dec/jbig2_symbol_dict.c
+++ b/jbig2dec/jbig2_symbol_dict.c
@@ -103,7 +103,7 @@ jbig2_sd_new(Jbig2Ctx *ctx, uint32_t n_symbols)
if (new_dict->glyphs != NULL) {
memset(new_dict->glyphs, 0, n_symbols * sizeof(Jbig2Image *));
- } else {
+ } else if (new_dict->n_symbols > 0) {
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, "unable to allocate glyphs for new empty symbol dict");
jbig2_free(ctx->allocator, new_dict);
return NULL;