summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShailesh Mistry <shailesh.mistry@hotmail.co.uk>2017-05-24 19:29:57 +0100
committerShailesh Mistry <shailesh.mistry@hotmail.co.uk>2017-05-27 18:02:36 +0100
commit3ebffb1d96ba0cacec23016eccb4047dab365853 (patch)
tree9c489f9ba5ca525d23ffa25a27458ed83e54338f
parent5cf06167c248f345a1042c421cc2f5f741bf281d (diff)
Bug 697934: Fix SEGV due to error code being ignored.
The return code from jbig2_decode_text_region was being ignored so the code continued to try and parse the invalid file using incomplete/empty structures.
-rw-r--r--jbig2dec/jbig2_symbol_dict.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
index 3cc17316f..672425d98 100644
--- a/jbig2dec/jbig2_symbol_dict.c
+++ b/jbig2dec/jbig2_symbol_dict.c
@@ -493,8 +493,10 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
}
/* multiple symbols are handled as a text region */
- jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
+ code = jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
n_refagg_dicts, image, data, size, GR_stats, as, ws);
+ if (code < 0)
+ goto cleanup4;
SDNEWSYMS->glyphs[NSYMSDECODED] = image;
refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]);