| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before commit 2b2dcf4ccf401ed210f03c858b304994749fd2b3 there was
a debug message when attempting to parse a a segment header and
the data supplied to jbig2dec was not enough. Commit 2b2dcf4
incorrectly changed the debug message into a fatal error message,
due misinterpreting the message text as something that warranted
a fatal error.
When data was supplied in chunks to jbig2_data_in() in repeated
calls such that a segment header's referred-to segment numbers
field straddled a chunk boundary then jbig2dec would indicate a
fatal error. The file in bug 702335 caused this to happen.
Instead jbig2dec should be asking the caller for more data so
that the entire segment header can be parsed during a single call
to jbig2_data_in().
By convering the fatal error back to a a debug message the problem
is resolved. The message itself is also rewored to clearly
indicate that the situation is non-fatal and that the caller will
be asked to provide more data.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Also move UINT32_MAX/INT32_MAX to internal header so they are defined
(the same) in every jbig2 source code file.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The specification in 5.4.4 states that numbers are unsigned unless
otherwise stated. 7.4.1.1 through 7.4.1.4 specifying the region segment
height, width, x and y do not mention that these fields are signed,
hence they ought to read and handled as unsigned.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
Like INT32_MAX and INT32_MIN, UINT32_MAX which is defined in stdint.h
is not defined for old versions of Visual Studio. Add simple definitions
in the two source files that use it, if it is not already defined.
|
|
|
|
|
|
| |
Previously this was a fatal error, but it is better as a warning as
the extension segment has not been marked necessary as outlined in
the specification.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This makes it clearer what is being returned upon error.
|
| |
|
|
|
|
|
| |
The information in the profile segment is simply printed
as informational messages via jbig2_error().
|
|
|
|
|
|
|
| |
T.88 Amendment 2 adds up to 12 adaptive template pixels in generic regions.
T.88 Amendment 3 adds support for generic/text regions to encode colors.
Neither amendment is implemented and no sample files have been found.
Return fatal errors for such bitstreams/files for the time being.
|
|
|
|
|
|
|
|
| |
The extension segment dependency bit only matters for
encoders. This is because it informs the encoder what
other segments a specific segment depends on. Since
jbig2dec doesn't do any alteration of segments this
need not be supported (or indeed even parsed).
|
| |
|
| |
|
|
|
|
|
|
|
| |
Only calls to jbig2_error() using fatal errors or warnings may
return, no calls to jbig2_error() using informational or debug
messages may return. This is preparation for jbig2_error() to
always return -1 for errors/warnings.
|
| |
|
|
|
|
| |
Due to this some .c-files now need new includes.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Also rename "new" to "new_dict", because "new" is a bad
variable name.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
ifdef out some used code.
Make some functions static that should be.
|
|
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.
|