summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2
AgeCommit message (Collapse)Author
2015-09-15Cleanup JBig2_GeneralDecoder.cpp.Lei Zhang
- FX_Alloc() can't fail and return. - Use unique_ptr / remove gotos. - NULL -> nullptr. - Combine common code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1337823003 .
2015-09-15Cleanup: Fix a typo. s/Processive/Processing/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1338573002 .
2015-09-11Convert some unneeded gotos into returns.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332193002 .
2015-09-11Cleanup casting of FX_Alloc() return values.Lei Zhang
Also convert some FX_AllocOrDie() calls to FX_Alloc(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332173002 .
2015-09-10Guard against null image data in CJBig2_GRRDProc.chromium/2509chromium/2508Lei Zhang
Credit to karl at skomski.com for the initial version of the CL. BUG=527174 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1305033006 .
2015-09-10Remove CJBig2_Object, CJBig2_Module, and friends.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1326953006 .
2015-09-03Remove CJBig2_Module::JBig2_Error and friends.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1327983003 .
2015-09-03Make a bunch of JBig2 classes independent of CJBig2_Object.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1319713003 .
2015-09-02Remove dead JBig2 code.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1328643002 .
2015-08-28Replace signed char with int8_t. Fix Linux ARM build after r7830e9e.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1321883002 .
2015-08-20Remove a bunch of dead JBIG2 code.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1293393002 .
2015-08-14Clean: Fix some unneeded semi-colons and bad spacing.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1284193005 .
2015-08-04clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
2015-07-27Revert "FX Bool considered harmful, part 3"Tom Sepez
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 .
2015-07-27FX Bool considered harmful, part 3Tom Sepez
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
2015-07-23Revert "FX_BOOL considered harmful, part 2."Tom Sepez
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
2015-07-23FX_BOOL considered harmful, part 2.Tom Sepez
Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 .
2015-07-23Fix FX_BOOL type mismatches.Tom Sepez
Extracted from https://codereview.chromium.org/1252613002/ R=thestig@chromium.org Review URL: https://codereview.chromium.org/1253603002 .
2015-07-22Merge to master: _FETAL => _FATAL.Tom Sepez
(cherry picked from commit 8a0a834d2aea61fc92590839b86471ac73daa967) Original Review URL: https://codereview.chromium.org/1247213002 . Note: inadvertantly landed on XFA first. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1252013002 .
2015-07-16Cleanup: Do not check pointers before deleting them, part 2.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 .
2015-07-10Make CJBig2_Object::operator delete accept nullptrchromium/2455Vitaly Buka
Standard delete operator should do noting for nullptr. Overloaded CJBig2_Object::operator delete de-referenced provided pointer causing crashes after https://codereview.chromium.org/1192743004/ TBR=thestig BUG=508197 Review URL: https://codereview.chromium.org/1230763007 .
2015-06-19Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
2015-06-15Do some IWYU cleanups.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1176333002.
2015-06-11Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
At one point in time, it may have made sense to indicate the expected alignment of the memory you're about to copy, but that was last century. The compiler will take care of it just fine. I stopped short of removing the FXSYS_ wrapper macros entirely. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1179693003.
2015-06-10Cleanup: Remove uses of "this->" in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1173223002.
2015-06-10Remove typdefs for pointer types in fx_system.h.Tom Sepez
This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003
2015-06-09Use stdint.h types throughout PDFium.Tom Sepez
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
2015-06-04Move fx_safe_types.h to include/ directory.Tom Sepez
Small bit of OCD here, since this file is included cross-library (i.e. from fpdfsk), it can't be in src/. In other words, the following should be empty: grep -R 'include.*core/src/' fpdfsdk Fix some IWYU in it at the same time. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1147353006
2015-05-21Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBufferJUN FANG
This issue is trigged by the conversion from unsigned int to signed int. A large unsigned int is converted to int. It's represented as a negative int which is used in the condition of while later. BUG=482639 R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1146913003
2015-05-20Integer overflow in CJBig2_Image::expandJUN FANG
1. New size should be larger than old size in JBig2_Realloc. 2. Arguments are integers but parameters are size_t in JBIG2_memset. After integer overflows, it will be presented as a huge unsigned number on 64 bits system. BUG=483981 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1148643002
2015-05-19Fix Heap Overflow in CJBig2_Image::expandJUN FANG
Integer overflow in CJBig2_Image::expand. It causes the size of reallocated is not expected. BUG=483981 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1131023008
2015-05-08Fix a bunch of -Wunused-but-set-variable warnings.Lei Zhang
Also fix a few nits and other errors along the way. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1098583002
2015-04-13Fix a heap overflow in CJBig2_Context::parseSymbolDictchromium/2371chromium/2370chromium/2369JUN FANG
BUG=476107 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1080893002
2015-01-09Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().chromium/2276chromium/2275chromium/2274chromium/2273Lei Zhang
BUG=445475 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/837093002
2015-01-09Fix -Wnon-virtual-dtor compiler warnings.Tom Sepez
This is done by explicitly adding a virtual dtor to interface classes, since the cost is small given that there are already virtual functions. The exceptions are for classes that have a Release() or Delete() method, in which case it is non-virtual and protected to indicate that the virtual class is never the deletion point. BUG= R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/810883005
2015-01-05Remove static declared SymbolDictCache.Bo Xu
This is a follow up CL on https://codereview.chromium.org/761313004/ BUG=https://code.google.com/p/pdfium/issues/detail?id=93 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/828183002
2014-12-17Add a small LRU cache for the JBIG2 symbol dictionary.Bo Xu
This reduces rendering time on my test document by over 10 seconds. It is super common for a JBIG2 dictionary to span multiple pages, so we don't want to decode the same dictionary over and over again. Original patch from Jeff Breidenbach (breidenbach@gmail.com) BUG=https://code.google.com/p/pdfium/issues/detail?id=85 R=bo_xu@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/761313004
2014-12-12Avoid duplicate definitions of JSCONST_n*Hash and QeTable variables.Bruce Dawson
QeTable is a 752 byte array that was defined in a header file. This caused it to be instantiated by the VC++ compiler 12 times, wasting 8,272 bytes of space in the data segment. Because 'const' implies 'static' this did not cause any duplicate symbol errors. JSCONST_n*HASH are a set of eight variables that are defined in a header file. This causes them to be replicated 15 times. The variables themselves are tiny but they are dynamically initialized and this dynamic initialization code is replicated 15 times. When tested on pdfium_test.exe the effect of this change is to: Reduce the .text (code) segment by 3,616 bytes. Reduce the .rdata section by 8,656 bytes. Reduce the total binary file size by 13312 bytes. These are the worst offenders for pdf.dll as shown in: https://drive.google.com/open?id=1BvubxoA2SU_2e4T5cq7jHTjc1TlT0qOndpIfX3DMeA8&authuser=0 This will also drastically simplify the list of work to be done for bug 441899 (getting rid of initializers). BUG=441988 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/802013002
2014-08-04Fix unninitialized 'tmp' in CJBig2_Image::composeTo_opt2Jun Fang
BUG=387811 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/437483004
2014-06-09free, rather than delete, malloc'd object.chromium/2076chromium/2075chromium/2074chromium/2073chromium/2072chromium/2071chromium/2070chromium/2069chromium/2068chromium/2067chromium/2066chromium/2065chromium/2064chromium/2063chromium/2061chromium/2060chromium/2059chromium/2058chromium/2057chromium/2056chromium/2055chromium/2054chromium/2053chromium/2052chromium/2051chromium/2050chromium/2049chromium/2048chromium/2047chromium/2046chromium/2045chromium/2044John Abd-El-Malek
BUG=381031 Original patch by Chris Palmer <palmer@chromium.org> Review URL: https://codereview.chromium.org/322453002
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek