summaryrefslogtreecommitdiff
path: root/jbig2dec/jbig2_arith_iaid.c
Commit message (Collapse)AuthorAgeFilesLines
* Update postal address in file headersChris Liddell2023-04-041-3/+3
|
* Update copyright to 2021Chris Liddell2021-03-151-1/+1
|
* Update copyright to 2020Chris Liddell2020-04-101-1/+1
|
* jbig2dec: Cast literal to avoid shifting outside of valid range.Sebastian Rasmussen2020-03-211-1/+1
| | | | Fixes Coverity CID 355175.
* jbig2dec: Fix signedness conversions.Sebastian Rasmussen2020-03-201-1/+1
|
* jbig2dec: Pass segment numbers as unsigned values to error callback.Sebastian Rasmussen2020-03-201-4/+4
| | | | | | | | | | | | | According to the JBIG2 specification segments numbers are 32 bit unsigned integer. Previously any segment numbers larger than INT32_MAX would be passed as negative numbers. Some parts of the decoder do not yet know, or do not have access to the currently decoded segment number, and this needs to be specially indicated. Therefore jbig2dec appropriates the unlikely segment number 0xffffffff to indicate an unknown segment number. This is a change of the public API.
* jbig2dec: Address all signedness comparison issues.Sebastian Rasmussen2020-03-201-3/+3
|
* jbig2dec: Add overflow detection for IAID context size.Sebastian Rasmussen2020-03-201-2/+11
|
* jbig2dec: Let arithmetic decoder and the underlying stream report errors.Sebastian Rasmussen2020-03-201-2/+2
| | | | | | When a called function indicates an error, the caller should print warnings. Since the arithmetic decoder now uses the normal way of reporting errors, the callers of the decoder are changed to report warnings.
* jbig2dec: Add more references to specification.Sebastian Rasmussen2020-03-201-0/+1
|
* jbig2dec: Simplify jbig2_arith_decode.Robin Watts2020-02-051-3/+2
| | | | | | | | | Previously we passed in an int * to get errors back, and used the return code for 0 or 1. Now we use the return code for 0, 1 or -ve for error. This saves between 1% and 2% of gs runtime for decoding tests/pdf/Jbig2_042_06.pdf.
* Update source/header file copyright notice to 2019Chris Liddell2019-01-161-1/+1
|
* jbig2dec: Rephrase jbig2_error() messages.Sebastian Rasmussen2018-07-311-2/+2
| | | | | | | | | | | | * Do not prefix messages with "jbig2 error:", this ought to be done by the error callback itself. * Avoid using function names in messages as they mean nothing to the end user. * Avoid contractions in messages. * Try to adhere to "failed to" pattern as far as possible. * Messages start with lower case character, unless it refers to something in the specification. * Messages do not end with punctuation.
* jbig2dec: Return NULL upon error, avoid returning variable.Sebastian Rasmussen2018-07-131-1/+1
| | | | This makes it clearer what is being returned upon error.
* jbig2dec: Remember to free IAID context upon error.Sebastian Rasmussen2018-07-131-3/+5
| | | | Previously this might result in a memory leak.
* jbig2dec: Improve error handling.Sebastian Rasmussen2018-04-111-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update copyright notice with new head office address.Ken Sharp2018-01-301-3/+3
| | | | | | | | | Also update copyright dates. Remove gs_cmdl.ps as we no longer use it, and remove its entry from psfiles.htm. Remove xfonts.htm as this feature (xfont support) is long, long gone.
* Bug 697531 : Tidy up unused code.Shailesh Mistry2017-02-151-2/+0
| | | | | | | | | | The first patch for this bug made the error return from jbig2_word_stream_buf_get_next_word pointless so this patch removes all the remaining redundant code. jbig2_word_stream_buf_get_next_word does not need to return any value so this is now defined as a void type and the rest of the code has been updated accordingly.
* Reindent jbig2dec source to follow gs coding style.Tor Andersson2016-04-081-51/+41
| | | | | | | | | | | | First a pass through gnu indent: indent \ -bad -nbap -nsob -br -ce -cli0 \ -npcs -ncs -i4 -di0 -psl -lp -lps -nut -l160 \ *.c *.h Followed by astyle to patch over some of the indentation bugs in gnu indent: astyle --style=kr -H -U -k3 *.c *.h
* Commit of build_consolidation branchChris Liddell2015-07-201-0/+113
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.