summaryrefslogtreecommitdiff
path: root/core/src/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-29 09:39:40 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-29 09:39:40 -0700
commit58a9ba4f2c0cb4122e6a278079f7c2ba7363ad51 (patch)
treebdd450fb9b9de6e37bb83e230817dc49e980b74c /core/src/fxcodec
parentd3fca8027a571369661fa1f2db4385befedd6518 (diff)
downloadpdfium-58a9ba4f2c0cb4122e6a278079f7c2ba7363ad51.tar.xz
XFA: Remove unused _JpegLoadIccProfile()
In turn, remove now unused _JpegIsIccMarker(). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1418653008 .
Diffstat (limited to 'core/src/fxcodec')
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index 4c002772e7..2ef7d35b2b 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -73,70 +73,6 @@ static void _error_do_nothing2(j_common_ptr cinfo, char*) {}
#define JPEG_MARKER_AUTHORTIME (JPEG_APP0 + 3)
#define JPEG_MARKER_MAXSIZE 0xFFFF
#define JPEG_OVERHEAD_LEN 14
-static FX_BOOL _JpegIsIccMarker(jpeg_saved_marker_ptr marker) {
- if (marker->marker == JPEG_MARKER_ICC &&
- marker->data_length >= JPEG_OVERHEAD_LEN &&
- (FXSYS_memcmp(marker->data,
- "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00",
- 12) == 0)) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL _JpegLoadIccProfile(j_decompress_ptr cinfo,
- uint8_t** icc_buf_ptr,
- FX_DWORD* icc_length) {
- if (icc_buf_ptr == NULL || icc_length == NULL) {
- return FALSE;
- }
- *icc_buf_ptr = NULL;
- *icc_length = 0;
- uint8_t* icc_data_ptr = NULL;
- FX_DWORD icc_data_len = 0;
- uint8_t count_icc_marker = 0;
- uint8_t num_icc_marker = 0;
- jpeg_saved_marker_ptr marker_list[256] = {NULL};
- for (jpeg_saved_marker_ptr cur_marker = cinfo->marker_list;
- cur_marker != NULL; cur_marker = cur_marker->next) {
- if (_JpegIsIccMarker(cur_marker)) {
- if (count_icc_marker == 0) {
- num_icc_marker = cur_marker->data[13];
- } else if (num_icc_marker != cur_marker->data[13]) {
- return FALSE;
- }
- int sn = cur_marker->data[12] - 1;
- if (sn < 0 || sn >= num_icc_marker) {
- return FALSE;
- }
- if (marker_list[sn] == NULL) {
- marker_list[sn] = cur_marker;
- } else {
- return FALSE;
- }
- count_icc_marker++;
- icc_data_len += (cur_marker->data_length - JPEG_OVERHEAD_LEN);
- }
- }
- if (count_icc_marker != num_icc_marker) {
- return FALSE;
- }
- if (num_icc_marker == 0) {
- return TRUE;
- }
- icc_data_ptr = FX_Alloc(uint8_t, icc_data_len);
- if (icc_buf_ptr == NULL) {
- return FALSE;
- }
- *icc_buf_ptr = icc_data_ptr;
- *icc_length = icc_data_len;
- for (int idx = 0; idx < num_icc_marker; idx++) {
- icc_data_len = marker_list[idx]->data_length - JPEG_OVERHEAD_LEN;
- FXSYS_memcpy(icc_data_ptr, marker_list[idx]->data + JPEG_OVERHEAD_LEN,
- icc_data_len);
- icc_data_ptr += icc_data_len;
- }
- return TRUE;
-}
static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo,
const uint8_t* icc_buf_ptr,
FX_DWORD icc_length) {