diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2018-04-06 00:41:01 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2018-04-11 11:45:12 +0800 |
commit | 2b2dcf4ccf401ed210f03c858b304994749fd2b3 (patch) | |
tree | ee354a8558b2d294ec8013ca55cf8ff785481cb1 /jbig2dec/jbig2_arith.h | |
parent | 7ede8fc2b5e8498619d1e32b6b7fbbf9f926a055 (diff) | |
download | ghostpdl-2b2dcf4ccf401ed210f03c858b304994749fd2b3.tar.gz |
jbig2dec: Improve error handling.
Some functions detected errors but would not return these
to the caller. These functions may now indicate errors:
jbig2_arith_decode(), jbig2_image_resize()
Errors detected by following functions were not always
handled, but they are now handled properly:
jbig2_arith_decode(), jbig2_arith_iaid_decode()
jbig2_arith_int_ctx_new(), jbig2_build_huffman_table()
jbig2_complete_page(), jbig2_image_compose()
jbig2_decode_refinement_region(), jbig2_ctx_new()
jbig2_image_resize(), jbig2_image_write_pbm()
jbig2_image_write_pbm_file(), jbig2_image_write_png()
jbig2_image_write_png_file(), jbig2_metadata_add()
jbig2_page_add_result(), jbig2_renew()
jbig2_strndup()
Some functions detected errors but did not fail early enough:
jbig2_decode_pattern_dict(), jbig2_decode_halftone_region()
jbig2_decode_mmr_line() detected errors but did not produce
suitable error messages. This has been rectified.
Finally, if a subfunction indicates an error by returning an
error code, the calling function will report a warning and
return, indicating failure.
Diffstat (limited to 'jbig2dec/jbig2_arith.h')
-rw-r--r-- | jbig2dec/jbig2_arith.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jbig2dec/jbig2_arith.h b/jbig2dec/jbig2_arith.h index 990205c2d..96b7ff387 100644 --- a/jbig2dec/jbig2_arith.h +++ b/jbig2dec/jbig2_arith.h @@ -28,7 +28,7 @@ typedef unsigned char Jbig2ArithCx; Jbig2ArithState *jbig2_arith_new(Jbig2Ctx *ctx, Jbig2WordStream *ws); /* decode a bit */ -bool jbig2_arith_decode(Jbig2ArithState *as, Jbig2ArithCx *pcx); +bool jbig2_arith_decode(Jbig2ArithState *as, Jbig2ArithCx *pcx, int *code); /* returns true if the end of the data stream has been reached (for sanity checks) */ bool jbig2_arith_has_reached_marker(Jbig2ArithState *as); |