summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec/fx_codec_jpeg.cpp
AgeCommit message (Collapse)Author
2015-12-22Revert "Cleanup: Remove unused CFX_PSRenderer and various encoders it used."Lei Zhang
This reverts commit 2d63eaaa39bb3d402c658b2a6e0eae50a30f1d89. Broke the Windows build, though it is likely the code is unused on Windows too. Review URL: https://codereview.chromium.org/1540993004 .
2015-12-22Cleanup: Remove unused CFX_PSRenderer and various encoders it used.Lei Zhang
- Simplify remaining encoders. - Hook up more of the encoding paths so failures get returned. - Clean up code to not pass by non-const ref, use bools, etc. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1545563003 .
2015-12-14Get rid of most instance of 'foo == NULL'Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1520063002 .
2015-12-14Get rid of most instance of 'foo != NULL'Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 .
2015-11-20Change |CCodec_ScanlineDecoder::m_Pitch| to FX_DWORDOliver Chang
This matches the type of the corresponding |CFX_DIBSource::m_Pitch|, where integer overflow is checked for FX_DWORD. This change is propagated to many other places. Also, check for integer overflow in |CCodec_RLScanlineDecoder::Create| during the calculation of |m_Pitch| since it aligns to 4 bytes while overflow was was previously checked without this alignment. R=tsepez@chromium.org, thestig@chromium.org BUG=555784 Review URL: https://codereview.chromium.org/1460033002 .
2015-11-19Add a missing setjmp() to CCodec_JpegDecoder::v_GetNextLine().Oliver Chang
If jpeg_read_scanlines() ends up calling the error callback, we longjmp into some undefined state. BUG=558840 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1463563003 .
2015-11-10Fix relative includes within core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1427633010 .
2015-11-05Fix all relative includes to third_party.chromium/2560chromium/2559chromium/2558chromium/2557Lei Zhang
- In non-standalone builds, use the provided jpeg library. - Run gn format over all the GN files. - Also roll DEPS for buildtools to c2f2598. BUG=541704 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1425153006 .
2015-10-30Remove external jpeg provider interface.Tom Sepez
It is unused in PDFium. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1407903005 .
2015-10-08Fix a bunch of sign mismatch warnings.Lei Zhang
Also remove some gotos and move code into an anonymous namespace. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 .
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-08-14Don't bother checking pointers before delete[] and FX_Free().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 .
2015-08-14Use override in more classes in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 .
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-22Re-land else-after-returnsTom Sepez
Revert "Revert "Fix else-after-returns throughout pdfium."" This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d. Fix one naming conflict. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243953004 .
2015-07-22Revert "Fix else-after-returns throughout pdfium."Tom Sepez
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
2015-07-22Fix else-after-returns throughout pdfium.Tom Sepez
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
2015-06-19Disintermediation.Tom Sepez
Removed several header files that simply proxy other headers. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1199553002.
2015-06-17Move libjpeg to third_party/Tom Sepez
Removal of fpdfapi_ suffix can be part of a future CL. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1186113005.
2015-06-11Remove trailing whitespaces in core.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1177973008.
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-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-08Remove more cruft from fx_system.hTom Sepez
- include system headers first and alphabetize. - remove unsupported FX_WIN32_MOBILE symbol. - actually define a FX_WIN64 symbol and make consistent. - use final/override, not FX_FINAL. - let stdint.h resolve FX_WORDSIZE concerns. - unused FX_ERR and FX_SUCCESS() macros. - unused FX_LSB_FIRST macro. - outline FX type deprecation plan. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1169963003
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-18Change FX_Alloc to FX_Try_Alloc in _JpegEncodeJUN FANG
This CL is used for: 1. keeping the same logic as before (the behaviour of FX_Alloc was changed for OOM). 2. fixing a potential integer overflow. BUG=N/A R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1126013006
2015-05-18Add safe FX_Alloc2D() macroTom Sepez
This avoids unchecked multiplications when computing a size argument to malloc(). Such an overflow is very scary, and can result in exploitable bugs. Along the way, kill off some return checks, since we know this can't return NULL. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1143663004
2015-04-16Replace FX_NEW with new, remote tests from fxcodecTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084303002
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-08Remove custom memory managerBo Xu
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
2014-06-05fix two uninitialized readsJohn Abd-El-Malek
https://code.google.com/p/pdfium/issues/detail?id=9 https://code.google.com/p/pdfium/issues/detail?id=10 BUG= R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/312273002
2014-06-04Wrong variable assignment in Pdfium.John Abd-El-Malek
CID=115579 Original patch by Finnur Thorarinsson <finnur@chromium.org>
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek