summaryrefslogtreecommitdiff
path: root/core/src/fxcodec
AgeCommit message (Collapse)Author
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-05-06Merge to XFA: Fix a couple of divide by zero crashes in PNG/TIFF predictors.Lei Zhang
BUG=484002 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1124563002 (cherry picked from commit 6ab919ff310fb02bab8cf43d92a5553b11cbbb61) Review URL: https://codereview.chromium.org/1130903002
2015-05-06Merge to XFA: Replace FX_NEW with new, remote tests from fxcodecLei Zhang
Review URL: https://codereview.chromium.org/1084303002 (cherry picked from commit cfc1a654ef3e8b65bc447815d35932c185bf1422) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1125363002
2015-04-21Merge to XFA: Fix a crashier due to images with abnormal sizeJUN FANG
BUG=453553 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1093323003
2015-04-14Merge to XFA: Kill CFX_Object.Tom Sepez
Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002
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-03-20Merge to XFA: Fix missing include for std::minTom Sepez
Original Review URL: https://codereview.chromium.org/1026843002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1025753002
2015-03-19Merge to XFA: Fix subtle issues in opj_skip_from_memory and add unit tests.Tom Sepez
Original Review URL: https://codereview.chromium.org/1016203002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1027443002
2015-03-16Merge to XFA: Fix a bug that JPX images can't be shownJUN FANG
In the process of opj_end_decompress, it will return fail when the end of coding stream is reached. However it returns true in the same scenario implemented in openJPEG. So the final solution is from openJPEG. Return true when the end of coding stream is reached. BUG=452671 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/990683002
2015-03-11XFA: bound memcpy length in _png_load_bmp_attribute()Tom Sepez
BUG=466338 R=thestig@chromium.org Review URL: https://codereview.chromium.org/997273002
2015-03-11Merge to XFA: Kill remaining sprintfsTom Sepez
There is fx_codec_png.cpp that has a sprintf under XFA that was not present in master. Original Review URL: https://codereview.chromium.org/999543002 R=thestig@chromium.org Review URL: https://codereview.chromium.org/995993002
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-02-27Merge to XFA: Cleanup: Get rid of CRLF line endings.Lei Zhang
Original URL: https://codereview.chromium.org/837533003 (cherry picked from commit 256ef88a26cff56fc7c23119d2d9e1b41468bd1a) Review URL: https://codereview.chromium.org/963403002
2015-02-27Merge to XFA: Upgrade openjpeg to revision 2997.JUN FANG
BUG=457493 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/960183004
2015-02-06Fix XFA build after combining PDFium into Chromium binary.John Abd-El-Malek
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/889253003
2015-02-02Merge the following changes to XFA branch:John Abd-El-Malek
b3a788e Fix GN PDFium build when building all. by John Abd-El-Malek - 19 hours ago chromium/2293 f8af677 Always use the FreeType headers included in PDFium. by John Abd-El-Malek - 24 hours ago dc8c950 Don't export any OpenJPEG methods from PDFium. by John Abd-El-Malek - 3 days ago 71c24b8 Use system FreeType on Linux. by John Abd-El-Malek - 3 days ago R=tsepez@chromium.org Review URL: https://codereview.chromium.org/900433002
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-12-15Remove more defines in XFA branch that aren't used for PDFium.John Abd-El-Malek
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/811493002
2014-12-15XFA: merge patch from issue 801913002 and 804463003John Abd-El-Malek
Simplify PDFium by removing code that's not used in the open source repo. -remove parameter from FPDF_InitLibrary -remove a bunch of ifdefs that are unused Fix build after previous commit. TBR=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/809513002
2014-11-24Merge to XFA: patch from CL 758593002Bo Xu
Update to openjpeg r2944 BUG=429139,430566,431288 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/758593002
2014-11-03Merge XFA to PDFium master at 4dc95e7 on 10/28/2014Bo Xu
2014-10-30Update openjpeg to r2920Bo Xu
BUG=414036, 425151 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/688633003
2014-10-22update openjpeg to r2911Bo Xu
BUG=418976, 425150, 414525 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/671943002
2014-10-21Update openjpeg to r2908chromium/2202chromium/2201chromium/2200chromium/2199chromium/2198chromium/2197Bo Xu
BUG=414089, 414310, 414606 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/670813002
2014-10-21More fixes in sycc422_to_rgb and sycc420_to_rgb when image width is oddBo Xu
This patch is supplementary to issue 418881 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/645793007
2014-10-15Fix licenses in headers to pass Chromium's checklicenses tool.chromium/2196chromium/2195chromium/2194chromium/2193chromium/2192chromium/2191Tom Sepez
This is a re-landing of the changes in https://pdfium.googlesource.com/pdfium/+/6387aff which were lost during a libopenjpeg library roll. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/661463003
2014-10-10Fix a bug when image width is odd in sycc422_to_rgbBo Xu
BUG=418881 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/648823002
2014-10-03check pointer overflow in t2.cBo Xu
BUG=413375 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/624023003
2014-09-30Update openjpegBo Xu
BUG=407964, 414182, 413447 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/589243004
2014-09-08Merge performance fix for cmsDupToneCurve from previous upstream branch.Chris Palmer
BUG= R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/534363002
2014-09-02Tidy up opj_ callback functions in fx_codec_jpx_obj.cppTom Sepez
This is code cleanup rather than bug fixing. The motivation for this was to fix the casts at line 97 of the original file. These are wrong; you cannot correct via casting a function signature mismatch when passing a function as an argument. In theory, there's no reason to believe that the compiler will pass args in the same manner for a function of type (void*, size_t, void*) as for a function of type (void*, size_t, some_struct*). The cast will suppress the compile error, but you can't be assured the call will work as intended. In practice, it does, since the last architecture where a void* had a different representation than a struct* went extinct in the late 80s. In the functions themselves, note that we currently bail out if srcData->offset >= srcData->src_size, so the expression bufferLength = (OPJ_SIZE_T)(srcData->src_size - srcData->offset) will always be > 0. Hence the check if(bufferLength <= 0) is pointless, esp. since bufferLength is a signed type and < 0 makes no sense. The opj_seek_from_memory() has a bool return value, so returning -1 on error doesn't seem reasonable. Change this to TRUE/FALSE, and return false on seek past end. If we're truly passing readonly data, then perhaps it makes sense to make the write() function always return -1. I didn't do this. Lastly, I capitalize "DecodeData" so that it looks like a struct, and change its members to be size_t's to avoid casting back and forth. R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/507273003
2014-08-27Restrict index not be greater than row_size in TIFF_PredictLineBo Xu
There is not strict way to limit invalid value of |Colors| from dictionary. We can make sure |index| does not go out of boundary of row_size. BUG=407614 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/509993003
2014-08-26Bounds check before fixed-size memcmp() in CJPX_Decoder::Init().Tom Sepez
BUG=407476 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/489703004
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/503883002
2014-08-25Revert of Use number of components from ICC profile and alternateCS ↵Bo Xu
(patchset #1 of https://codereview.chromium.org/493163003/) Reason for revert: Needs to address comments before landing Original issue's description: > Use number of components from ICC profile and alternate color space > > BUG=406806 > > Committed: https://pdfium.googlesource.com/pdfium/+/be83103 TBR=tsepez@chromium.org,jun_fang@foxitsoftware.com NOTREECHECKS=true NOTRY=true BUG=406806 Review URL: https://codereview.chromium.org/504883003
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 Review URL: https://codereview.chromium.org/493163003
2014-08-15Fix buffer size offset error in PNG_PredictorBo Xu
BUG=393602 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/466153005
2014-08-13Remove try/catch blockBo Xu
BUG=pdfium:28 R=thakis@chromium.org Review URL: https://codereview.chromium.org/472563002
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-07-30Remove a few unused variables, functions, and member variables.Nico Weber
No intended behavior change. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/426763003
2014-07-29Fix a few more warnings in chromium_code mode.Nico Weber
No intended behavior change. - Remove more unused variables, functions, member variables. - Put a few constructor initializers in the order they execute in. - Add braces for subobject initializers. - Fix a handful of signed / unsigned comparisons. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/429593005
2014-07-23Remove unnecessary aligned memory check when __SSE__ is usedBo Xu
Since the land of https://pdfium.googlesource.com/pdfium/+/3522876d5291922ddc62bf1b70d02743b0850673, memory is assured to be 16 byte aligned. So no need to do this check. Plus, the removed code was causing bug in M36: https://code.google.com/p/pdfium/issues/detail?id=27. BUG=None R=thestig@chromium.org Review URL: https://codereview.chromium.org/418563002
2014-07-14Fix uninitialized Storage in _LUTeval16foxit
BUG=387826 R=palmer@chromium.org Review URL: https://codereview.chromium.org/387273002
2014-07-10Fix uninitialized Storagefoxit
BUG=387843 R=palmer@chromium.org Review URL: https://codereview.chromium.org/380293002
2014-07-08Remove custom memory managerBo Xu
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
2014-06-20Fix a crash in CFXMEM_FixedMgr::AllocLargefoxit
BUG=382243 R=palmer@chromium.org Review URL: https://codereview.chromium.org/333213002
2014-06-20Stack-buffer-overflow in IccLib_Translatefoxit
BUG=382240 R=palmer@chromium.org Review URL: https://codereview.chromium.org/332143002