shithub: jbig2

Download patch

ref: 471dabc8b157f9a841e4f0090e3c2ff016915fd9
parent: 398186762d6f73d1632d8c6d846f2066c3087751
author: Sebastian Rasmussen <sebras@gmail.com>
date: Thu Apr 5 20:41:01 EDT 2018

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.