summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2
AgeCommit message (Collapse)Author
2015-10-02Merge to XFA: Prevent divide by zeros in CJBig2_GSIDProc::decode_MMR().Lei Zhang
Check the image size before attempting to decode. BUG=538103 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1377493005 . (cherry picked from commit 9fb70fbded5c0bf4f5313a49fd3496b4d4fa71ca) Review URL: https://codereview.chromium.org/1379233003 .
2015-10-01Merge to XFA: Disable JBIG2 cache; prevent data corruptionLei Zhang
BUG=pdfium:207 Original author: jbreiden@google.com Original CL: http://codereview.chromium.org/1362133003/ TBR=jbreiden@google.com Review URL: https://codereview.chromium.org/1382073002 . (cherry picked from commit 7886d8dcf3bc9ef9b51e733d77bd3243ef32adb8) Review URL: https://codereview.chromium.org/1379603004 .
2015-10-01Merge to XFA: Cleanup JBig2_ArithIntDecoder.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1359013003 . (cherry picked from commit ce37d7347f1ab4c9fc1f48a137628da641bb4f14) Review URL: https://codereview.chromium.org/1386473002 .
2015-09-29Merge to XFA: Cleanup CJBig2_ArithDecoder.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1368153003 . (cherry picked from commit 0fef7dd405ac85660dbeddd2e47620daffa70cb5) Review URL: https://codereview.chromium.org/1381633003 .
2015-09-28Merge to XFA: Cleanup some fx_codec_fax.cpp code.Lei Zhang
R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1367633005 . (cherry picked from commit 39cd934a4705f69c30e1bbf13eab347f66999020) Review URL: https://codereview.chromium.org/1370273002 .
2015-09-24Merge to XFA: Fix a leak in CJBig2_Context.Lei Zhang
- Remove dead code - Use unique_ptr BUG=pdfium:202 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1365903002 . (cherry picked from commit 01c1e54a506329b36f87b0e37d3b419b70973342) Review URL: https://codereview.chromium.org/1371513002 .
2015-09-24Merge to XFA: Split up JBig2_GeneralDecoder.cpp.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1359233002 . (cherry picked from commit 630a28442364f03c1d3d9b48873da42755e1fddf) Review URL: https://codereview.chromium.org/1364083004 .
2015-09-17Merge to XFA: Convert some unneeded gotos into returns.Lei Zhang
R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332193002 . (cherry picked from commit da0938f8671958aba0522a69fc687a7bbb01b435) Review URL: https://codereview.chromium.org/1350453002 .
2015-09-15Merge to XFA: Cleanup JBig2_GeneralDecoder.cpp.Lei Zhang
- FX_Alloc() can't fail and return. - Use unique_ptr / remove gotos. - NULL -> nullptr. - Combine common code. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1337823003 . (cherry picked from commit d15cda90f598ce52fa601552577ef7fd8a89fce3) Review URL: https://codereview.chromium.org/1349463002 .
2015-09-15Merge to XFA: Cleanup: Fix a typo. s/Processive/Processing/Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1338573002 . (cherry picked from commit a5fde67ea3c9d20d3f19354ec9e7e1be600d7589) Review URL: https://codereview.chromium.org/1350463002 .
2015-09-15Merge to XFA: Cleanup casting of FX_Alloc() return values.Lei Zhang
Also convert some FX_AllocOrDie() calls to FX_Alloc(). TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332173002 . (cherry picked from commit 6aca3e209ff6148f1d77b86b8b97d3bdf18e3eba) Review URL: https://codereview.chromium.org/1344233002 .
2015-09-10Merge to XFA: Guard against null image data in CJBig2_GRRDProc.Lei Zhang
Credit to karl at skomski.com for the initial version of the CL. BUG=527174 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1305033006 . (cherry picked from commit 89d8b4681ce98894a1ee1a6cf4bae77e00d28797) Review URL: https://codereview.chromium.org/1331303002 .
2015-09-10Merge to XFA: Remove CJBig2_Object, CJBig2_Module, and friends.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1326953006 . (cherry picked from commit 70f4404e9a9e69afdfdd07715aa946f6561ce0cb) Review URL: https://codereview.chromium.org/1336783002 .
2015-09-10Merge to XFA: Remove CJBig2_Module::JBig2_Error and friends.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1327983003 . (cherry picked from commit 6087a2f18e0c779c1bae62812801cee98fe8a09d) Review URL: https://codereview.chromium.org/1335793003 .
2015-09-10Merge to XFA: Make a bunch of JBig2 classes independent of CJBig2_Object.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1319713003 . (cherry picked from commit 800bf5ac07305ccf9c9522c8c76f728a4fd99da5) Review URL: https://codereview.chromium.org/1332153002 .
2015-09-03Merge to XFA: Remove dead JBig2 code.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1328643002 . (cherry picked from commit 9df5d9701ddf75f8050566132694bf435efb3ca0) Review URL: https://codereview.chromium.org/1319563003 .
2015-08-28Merge to XFA: Replace signed char with int8_t. Fix Linux ARM build after ↵Lei Zhang
r7830e9e. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1321883002 . (cherry picked from commit 5e4a5cc9ad76dc08d62fb1e10bdfb811f3720c43) Review URL: https://codereview.chromium.org/1308163005 .
2015-08-20Merge to XFA: Remove a bunch of dead JBIG2 code.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1293393002 . (cherry picked from commit 7830e9e38d4155335b7287f8edb2b3a6cece5b01) Review URL: https://codereview.chromium.org/1303013004 .
2015-08-14Merge to XFA: Cleanup: Fix some unneeded semi-colons and bad spacing.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1284193005 . (cherry picked from commit 632b807b386878afdb42322f0037f8998306f4a9) Review URL: https://codereview.chromium.org/1301453002 .
2015-08-04XFA: clang-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|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-07-23Merge to XFA: FX_BOOL combo patch.Tom Sepez
Original Review URL: https://codereview.chromium.org/1257503002 Original Review URL: https://codereview.chromium.org/1253603002 Manual merge for: core/include/fxge/fx_font.h core/src/fxcodec/codec/codec_int.h fpdfsdk/src/javascript/PublicMethods.cpp R=thestig@chromium.org Review URL: https://codereview.chromium.org/1248153004 .
2015-07-22_FETAL => _FATAL.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1247213002 .
2015-07-16Merge to XFA: Cleanup: Do not check pointers before deleting them, part 2.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 . (cherry picked from commit 21bf242a31eff79f754c5e9c3b41c52e33483bb0) Review URL: https://codereview.chromium.org/1235753006 .
2015-06-19Merge to XFA: Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004. (cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271) Review URL: https://codereview.chromium.org/1196783003.
2015-06-19Merge to XFA: Do some IWYU cleanups.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1176333002. (cherry picked from commit 0ef0de55657db8a83372ad8eb22d84c5893afc4c) Review URL: https://codereview.chromium.org/1195943005.
2015-06-13Merge to XFA: Cleanup: Remove uses of "this->" in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1173223002. (cherry picked from commit 2b5e0d5b20654d116045484868c9e015ed698124) Review URL: https://codereview.chromium.org/1186673004.
2015-06-11Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp follwed by scripts. Original Review URL: https://codereview.chromium.org/1179693003. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1179953002.
2015-06-10Merge to XFA: Remove typdefs for pointer types in fx_system.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
2015-06-09Merge to XFA: Use stdint.h types throughout PDFium.Tom Sepez
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
2015-06-04Merge to XFA: Move fx_safe_types.h to include/ directory.Tom Sepez
Original Review URL: https://codereview.chromium.org/1147353006 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1152693005
2015-05-21Merge to XFA: Fix 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-20Merge to XFA: Integer 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-19Merge to XFA: Fix 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-08Merge to XFA: Fix a bunch of -Wunused-but-set-variable warnings.Lei Zhang
Also fix a few nits and other errors along the way. Review URL: https://codereview.chromium.org/1098583002 Review URL: https://codereview.chromium.org/1135713004 (cherry picked from commit f0a169e6fd5718995fa6ef8749c8d16cdad84985) (cherry picked from commit 470408c2ffe71e99cebad0d1d6887f1723f02cef) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1133453006
2015-04-13Merge to XFA: Fix a heap overflow in CJBig2_Context::parseSymbolDictJUN FANG
BUG=476107 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1080893002
2015-02-27Merge to XFA: Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().Lei Zhang
Original URL: https://codereview.chromium.org/837093002 (cherry picked from commit f8105c665856863ad95da37fee6c12b98b953e2c) Review URL: https://codereview.chromium.org/967033002
2015-01-09merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.Tom Sepez
Original at URL: https://codereview.chromium.org/810883005 Note that the new code in XFA introduces many more of these, to be handled separately. TBR=brucedawson@chromium.org TBR=thestig@chromium.org BUG=https://code.google.com/p/pdfium/issues/detail?id=102 Review URL: https://codereview.chromium.org/842223004
2015-01-05XFA: merge patch from CL 828183002, remove static declared SymbolDictCacheBo Xu
Remove static declared SymbolDictCache. 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-19XFA: merge patch from CL 761313004Bo Xu
Add a small LRU cache for the JBIG2 symbol dictionary. 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-19XFA: merge patch from CL 441988Bruce Dawson
Avoid duplicate definitions of JSCONST_n*Hash and QeTable variables. 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