summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2/JBig2_Context.cpp
AgeCommit message (Collapse)Author
2015-12-24Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr.Lei Zhang
TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 . (cherry picked from commit d20dfba2ae10e8aeb328328f09da79ff904110a8) Review URL: https://codereview.chromium.org/1545183002 .
2015-12-22Merge to XFA: Start using allowed C++11 features.Lei Zhang
TBR=dml@google.com, thakis@chromium.org Review URL: https://codereview.chromium.org/1544923002 . Review URL: https://codereview.chromium.org/1545823002 . (cherry picked from commit ba2586d2c0a50df14aa2549a0a841e1d4b9af4b6) (cherry picked from commit 87f7d29531dabfd66e547a6be31a08272ff631d5) Review URL: https://codereview.chromium.org/1542213002 .
2015-12-18Merge to XFA: Cleanup CJBig2_HuffmanTable and friends.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1536923002 . (cherry picked from commit 9c061e2dfb22a0e321728b73c8650eded8828d90) Review URL: https://codereview.chromium.org/1539023002 .
2015-12-18Merge to XFA: Fix the JBIG2 decoding regressions from commit bc4b82e and ↵Lei Zhang
8a9ce57. BUG=566063 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1534323002 . (cherry picked from commit 20c8a9a66ea710b96493c9048fb65753e68b48fc) Review URL: https://codereview.chromium.org/1540673003 .
2015-10-19Merge to XFA: Sanity check the values of TRUE and FALSE.Lei Zhang
Get rid of cond ? TRUE : FALSE. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405723003 . (cherry picked from commit aff4635dad81bc319266d9d84b81552580cd2b65) Review URL: https://codereview.chromium.org/1412793003 .
2015-10-09Merge to XFA: Sanitize CJBig2_SymbolDict's memory usage.Lei Zhang
- Use std::vector<JBig2ArithCtx> instead of storing pointers to arrays. - Make CJBig2_SymbolDict's members private with accessors. - Use std::vector<JBig2ArithCtx> in related places. - Steal Chromium's vector_as_array() and use it as an adaptor as needed. BUG=514891 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1388203003 . (cherry picked from commit 3acb1ef909a22368507ed13817c4988c818e3aee) Review URL: https://codereview.chromium.org/1401533004 .
2015-10-08Merge to XFA: Various changes to JBig2 cache:Lei Zhang
- Makes the cache be per-document - Keys the cache on ObjNum and stream offset instead of keying on a pointer to the data (which can result in false cache hits). - Makes it so the cache is only used for the globals stream. - Reenable the cache. R=dml@google.com TBR=dml@google.com BUG=pdfium:207 Review URL: https://codereview.chromium.org/1380243004 . (cherry picked from commit f1b88e76134808f36f16b9e53a2e9dd89b12c8fd) Review URL: https://codereview.chromium.org/1394373002 .
2015-10-08Merge to XFA: Put CJBig2_SymbolDict's images in a CJBig2_List container.Lei Zhang
Also mark it private. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1395613003 . (cherry picked from commit 8793b4a071fad51a770b93838e0752505b020e43) Review URL: https://codereview.chromium.org/1397853002 .
2015-10-07Merge to XFA: Fix the Windows build after commit 8a9ce57.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1396533002 . (cherry picked from commit 80aa8c26887d98f654a9eecf7298663656cfc40f) Review URL: https://codereview.chromium.org/1396743002 .
2015-10-07Merge to XFA: Remove gotos in JBig2 code.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1382613003 . (cherry picked from commit 8a9ce5778e0789beb7ba15a62c592a353a51bcdd) Review URL: https://codereview.chromium.org/1397683002 .
2015-10-05Merge to XFA: Disable JBIG2 cache; prevent data corruption - try 2.Lei Zhang
Also change CJBig2_SymbolDict::DeepCopy() to return a unique_ptr to prevent a potential leak if the cache size was 0. BUG=pdfium:207 R=tsepez@chromium.org, jbreiden@google.com Review URL: https://codereview.chromium.org/1374633004 . (cherry picked from commit fd12ec5584d9a17f310a2c0c408a438ef3b1ce63) Review URL: https://codereview.chromium.org/1390673002 .
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-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: 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-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-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-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-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-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-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-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