summaryrefslogtreecommitdiff
path: root/core/src/fxcodec
AgeCommit message (Collapse)Author
2015-10-20XFA: Remove cond ? TRUE : FALSE.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1409323003 .
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-16Merge to XFA: Fix a bunch of sign mismatch warnings.Lei Zhang
Also remove some gotos and move code into an anonymous namespace. And then do the partial revert to avoid size_t going negative. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 . Review URL: https://codereview.chromium.org/1400723002 . (cherry picked from commit d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd) (cherry picked from commit a398ca611d1925182ff6a4e8b2b43c277c364dc0) Review URL: https://codereview.chromium.org/1406373002 .
2015-10-12XFA: Move fx_codec's lpng and tiff to third_party/Tom Sepez
We did this with the other codecs in master, but these two are XFA-only, and did not get the same treatment. Remove some fx_ prefixes in the third-party file names. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1392373004 .
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-09Merge to XFA: Fix include paths for fx_system.hLei Zhang
TBR=dml@google.com Review URL: https://codereview.chromium.org/1390863002 . (cherry picked from commit fb0334733cf4a541636128f77f9fe8067a8c70f6) Review URL: https://codereview.chromium.org/1395213003 .
2015-10-09Merge to XFA: Fix a compiling error on MacJun Fang
BUG=497357 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1395493003 .
2015-10-09Merge to XFA: Fix heap-buffer-overflow in color_sycc_to_rgbJun Fang
It's a bug existing in the conversion from YUV420 to RGB. For YUV 420 format, four pixels have 4 Y but only one U and one V. In some cases, there are odd columns or lines in some images. The pixels on last line or column may have Y but no U or V data. For this case, We shall extend U or V using the data on previous column or line. BUG=497357 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1342683002 .
2015-10-08Merge to XFA: Fix a malloc/delete mismatch introduced in commit 8a9ce57.Lei Zhang
Just get rid of the malloc altogether and use CJBig2_List instead. BUG=540873 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1394933002 . (cherry picked from commit 06f255ca4040f3d73cf09f1dbd63a3b167f6a4c1) Review URL: https://codereview.chromium.org/1400663003 .
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: Stop inlining CJBig2_BitStream.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1393823002 . (cherry picked from commit a0f2b67bd659e3f1780edfac56d8754bca685d5f) Review URL: https://codereview.chromium.org/1390883004 .
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-07Merge to XFA: Fix regression in JBIG2 decoding from commit ce37d73.Lei Zhang
many callers can tolerate CJBig2_ArithIntDecoder::decode() OOB failure. BUG=539749, pdfium:209 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1384663007 . (cherry picked from commit 35902e725aa6cc83a317c3b6fdd1926b81b8e44b) Review URL: https://codereview.chromium.org/1396663003 .
2015-10-07Merge to XFA: Remove some dead code from CCodec_Jbig2Module. Variable was ↵Lei Zhang
only ever set to false. TBR=dml@google.com Review URL: https://codereview.chromium.org/1393153002 . (cherry picked from commit 1f439a7a3b7c44235ecdac9a411add8fb62b0d83) Review URL: https://codereview.chromium.org/1392873003 .
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: Get rid of gotos in CPDF_SyntaxParser and FlateUncompress().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1360103002 . (cherry picked from commit b8a074711108baf04017d86207e08c19ff327d8e) Review URL: https://codereview.chromium.org/1384123002 .
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-02Merge to XFA: Fix PNG decoding divide by zero error due to zero row count.Lei Zhang
BUG=537790 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1379243002 . (cherry picked from commit 095a83c59120c108d9ac6f0ab71fd3faa5eea810) Review URL: https://codereview.chromium.org/1380563003 .
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: Clean up some image decoder classes:Lei Zhang
- Use std::vector<uint8_t> instead of raw uint8_t* - Make ICodec_ScanlineDecoder::GetScanline() return const uint8_t* - Add FxFreeDeleter, use it in CCodec_ImageDataCache. - Make CCodec_ImageDataCache encapsulate its data members. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1361053002 . (cherry picked from commit 022da0014faa103901ec107ed6a33e5ab00c7931) Review URL: https://codereview.chromium.org/1372993003 .
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-23Merge to XFA: Fix a leak in CJBig2_CachePair.Lei Zhang
TBR=jbreiden@google.com Review URL: https://codereview.chromium.org/1346043003 . (cherry picked from commit b6b336a0a1849526f66c49588daa2ccdd09d42cd) Review URL: https://codereview.chromium.org/1365813004 .
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-09-03Merge to XFA: Reapply Foxit's libopenjpeg modifications.Lei Zhang
They were lost in commit d53e6fd. BUG=pdfium:168 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1196523002 . (cherry picked from commit 870b5b6793fa261f0c6f31f026010d2d715968bf) Review URL: https://codereview.chromium.org/1301323007 .
2015-09-03Merge to XFA: Cleanup dead code in CPDF_DIBSource::LoadJpxBitmap() and friends.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1310603006 . (cherry picked from commit 097297325e0d3d00556d67885547750a2e9d4b32) Review URL: https://codereview.chromium.org/1305223010 .
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-19Merge to XFA: CFX_MapByteStringToPtr considered harmful (combo patch).Tom Sepez
New manual edits: two unused members deleted, one adapted. fde_csscache.cpp fde_csscache.h fpdfxfa_doc.h fx_ge_fontmap.cpp (cherry picked from commit 1d9dbd53b205b2b4d9e75a7eeb95e80837917ea3) (cherry picked from commit cb4d0ea68308e3c51a6ba9551b393bb2f639afc4) (cherry picked from commit 9cf44c2ed09a8b2ff243eb6dbb72a8cceae1b5ff) (cherry picked from commit 2a2a6aa7f51352fc481e78f6ad9d41f2738bcc48) (cherry picked from commit ce4ffb8183af3fa2bb5133f0f7370a88e064c516) Original Review URL: https://codereview.chromium.org/1297723002 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1301793002 .
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-14Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
2015-08-14Merge to XFA: Use override in more classes in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 . (cherry picked from commit c2c3f7b5f0396409451a9d344f35ec1929a76e9f) Review URL: https://codereview.chromium.org/1296043002 .
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-23Merge to XFA - else after returns.Tom Sepez
(cherry picked from commit 3c012fef2bb72c8ec1faa73e11ee35539b2559d6) Original Review URL: https://codereview.chromium.org/1243953004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1239313005 .
2015-07-22Merge to XFA: Remove dead code found by Scythe.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1249643003 . (cherry picked from commit b05f1fd710496dea44b001bb905fa1c16a39bb28) Review URL: https://codereview.chromium.org/1250433003 .
2015-07-22_FETAL => _FATAL.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1247213002 .