summaryrefslogtreecommitdiff
path: root/fitz/filt_faxd.c
AgeCommit message (Collapse)Author
2013-06-20Rearrange source files.Tor Andersson
2013-06-19Exception handling changesRobin Watts
In preparation for work on progressive loading, update the exception handling scheme slightly. Until now, exceptions (as thrown with fz_throw, and caught with fz_try/fz_catch) have merely had an informative string. They have never had anything that can be compared to see if an error is of a particular type. We now introduce error codes; when we fz_throw, we now always give an error code, and can optionally (using fz_throw_message) give both an error code and an informative string. When we fz_rethrow from within a fz_catch, both the error code and the error message is maintained. Using fz_rethrow_message we can 'improve' the error message, but the code is maintained. The error message can be read out using fz_caught_message() and the error code can be read as fz_caught(). Currently we only define a 'generic' error. This will expand in future versions to include other error types that may be tested for.
2013-06-18Merge common and internal headers into one.Tor Andersson
2013-06-18Move header files into separate include directory.Tor Andersson
2013-01-11Attempt to fix SEGVs seen in fax decoder.Robin Watts
Talking to zeniko, he reports that SEGVs still occur in find_changing within the fax decoder; he doesn't have an example that shows the problem though (either one he can share, or one he cannot). Presumably he has some sort of online feedback thing in the event of crashes. Having stared at the code for a while, I see a potential problem. I think the code may read too many bytes in the case where we are entered with x already within the last byte of w. (i.e. where x >= ((w-1)>>3)<<3). Fixed here.
2012-12-14Bug 693503: Fix out of bounds memory access (fax decoder)Robin Watts
With illegal fax streams we could access beyond the right hand edge of the allocated line. Fix this by adding some simple checks. Issue found by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google Security Team using Address Sanitizer. Many thanks!
2012-11-21Bug 693458: Fix typo in fax decoder.Robin Watts
Silly slip in my optimised code that results in failing to find differences at the ends of lines.
2012-11-20Obsess about whitespace.Tor Andersson
2012-11-19Enable android profiler build.Robin Watts
Requires android-ndk-profiler to be copied into android and android/jni. Also requires r8c of the NDK.
2012-11-19Attempt to speed up fax decompression.Robin Watts
A huge number of calls are made to getbit from find_changing in fax decompression. On Android profiling shows that this accounts for 25% of time in handling page 2 of IA3Z0845.pdf. Rewrite code to deal with bytes at a time for speed. Profiling now shows 5% in this function.
2012-05-23Make CCITTFax tables static.Tor Andersson
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-01-27Remove dependency on fz_obj from the filter creation parameters.Tor Andersson
2012-01-25Fix bug in Fax decoder.Robin Watts
Thanks to Zeniko for this; one line fix in the fax decoder, to cope with a case at the start of lines. This fixes: x - 1d faxd overflow.pdf and x - 1d faxd negative code.pdf
2012-01-10Fix many spelling errors.Sebastian Rasmussen
2011-12-17More memsqueezing fixes; stream creation.Robin Watts
2011-12-17Change stream 'close' functions to facilitate error cleanup.Robin Watts
Rather than passing a stream to a close function, just pass context and state - that's all that is required. This enables us to call close to cleanup neatly if the stream fails to allocate.
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-12-08Throw exceptions for read errors.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-21Don't thread ctx through safe fz_obj functions.Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-09-14Initial import of exception handling codeRobin Watts
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
2011-04-08Remove inline keyword where it is not strictly necessary for performance.Tor Andersson
Also put the function on the same line for inline functions, so they stick out and are easy to find with grep.
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-03-27Set the result pointer after swapping buffers.Michael Kaiser
In the CCITTFaxDecode filter, the result pointer was reset before swapping the buffers, so each line was copied to the output buffer only after decoding the following line. This was leading to a duplication of the first line and a missing last line.
2011-02-02Remove pdf_token_e typedef since the list of tokens is extended by ↵Tor Andersson
individual parsers, resulting in compiler warnings.
2010-12-12Remove unused function in CCITT fax decoding.Sebastian Rasmussen
2010-08-12Remove pdf_image struct -- load images directly into fz_pixmaps instead.Tor Andersson
2010-08-11Revert fax decoder workaround that caused inline fax images with rtc markers ↵Tor Andersson
to break.
2010-08-11Unstuff extra bytes read when the filters are closed instead of only when ↵Tor Andersson
EOD is encountered.
2010-08-11Only decode as many rows as fit in the output buffer in the fax decoder, ↵Tor Andersson
thus allowing garbage data at the end of fax images with no RTC and no Rows count.
2010-08-02Use 'while (rp < wp)' idiom for filter output buffering state.Tor Andersson
2010-08-02Fix bugs where pointer to remaining data in filters was not updated, also ↵Sebastian Rasmussen
make all occurances of the code follow a common idiom.
2010-07-29Use chained reader like interface for filters instead of process interface.Tor Andersson
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-07-09Rearrange and merge some files in the fitz directory.Tor Andersson
2010-07-01Remove silly warnings from MSVC.Tor Andersson
2009-12-03Consolidate include lines to a single fitz.h.Tor Andersson
2009-12-01Return filter instead of fz_okay.Tor Andersson
2009-11-29Fix up indentation.Tor Andersson
2009-11-20Malloc cannot return null. Clean up streams and filters.Tor Andersson
2009-11-19Remove unused and largely untested encoding filters.Tor Andersson
2009-06-09Fix off by one in faxd boundary checking.Sebastian Rasmussen
2009-05-23Do bounds checking for faxd scanlines.Sebastian Rasmussen
2009-03-16Fix some Coverity issues.Tor Andersson
2009-03-11Remove fz_outofmem constant.Tor Andersson
2009-03-11Change fz_error* struct into an integer error type fz_error.Tor Andersson
2009-02-28Merge and move header files into the source directories.Tor Andersson