From 1b5084321ed924ad3fcc437c3effc81baafd18ac Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 19 Oct 2015 11:49:57 -0700 Subject: Add FPDFAPIJPEG_ prefix to more libjpeg functions Original patch by Evangelos Foutras. Chromium built with use_system_libjpeg=1 can mistakenly try to use symbols exported by the libjpeg library that's bundled with pdfium. These name conflicts result in failure to encode the contents of a canvas element using toDataURL('image/jpeg'). BUG=505226 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1409243004 . --- core/include/thirdparties/libjpeg/jpeglib.h | 35 +++++++++++++++++++++++++++++ third_party/libjpeg/jpeglib.h | 35 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/core/include/thirdparties/libjpeg/jpeglib.h b/core/include/thirdparties/libjpeg/jpeglib.h index 7de5ab726e..f6af4f2b47 100644 --- a/core/include/thirdparties/libjpeg/jpeglib.h +++ b/core/include/thirdparties/libjpeg/jpeglib.h @@ -20,33 +20,53 @@ #define jdiv_round_up FOXIT_PREFIX(jdiv_round_up) #define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer) #define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer) +#define jinit_c_coef_controller FOXIT_PREFIX(jinit_c_coef_controller) +#define jinit_c_main_controller FOXIT_PREFIX(jinit_c_main_controller) +#define jinit_c_master_control FOXIT_PREFIX(jinit_c_master_control) +#define jinit_c_prep_controller FOXIT_PREFIX(jinit_c_prep_controller) +#define jinit_color_converter FOXIT_PREFIX(jinit_color_converter) #define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter) +#define jinit_compress_master FOXIT_PREFIX(jinit_compress_master) #define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller) #define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller) #define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller) +#define jinit_downsampler FOXIT_PREFIX(jinit_downsampler) +#define jinit_forward_dct FOXIT_PREFIX(jinit_forward_dct) #define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder) +#define jinit_huff_encoder FOXIT_PREFIX(jinit_huff_encoder) #define jinit_input_controller FOXIT_PREFIX(jinit_input_controller) #define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct) #define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader) +#define jinit_marker_writer FOXIT_PREFIX(jinit_marker_writer) #define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress) #define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr) #define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler) #define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder) +#define jinit_phuff_encoder FOXIT_PREFIX(jinit_phuff_encoder) #define jinit_upsampler FOXIT_PREFIX(jinit_upsampler) +#define jpeg_CreateCompress FOXIT_PREFIX(jpeg_CreateCompress) #define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress) #define jpeg_abort FOXIT_PREFIX(jpeg_abort) +#define jpeg_abort_compress FOXIT_PREFIX(jpeg_abort_compress) #define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress) +#define jpeg_add_quant_table FOXIT_PREFIX(jpeg_add_quant_table) #define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table) #define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table) #define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions) #define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input) +#define jpeg_default_colorspace FOXIT_PREFIX(jpeg_default_colorspace) #define jpeg_destroy FOXIT_PREFIX(jpeg_destroy) +#define jpeg_destroy_compress FOXIT_PREFIX(jpeg_destroy_compress) #define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress) +#define jpeg_fdct_ifast FOXIT_PREFIX(jpeg_fdct_ifast) +#define jpeg_fdct_islow FOXIT_PREFIX(jpeg_fdct_islow) #define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer) +#define jpeg_finish_compress FOXIT_PREFIX(jpeg_finish_compress) #define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress) #define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output) #define jpeg_free_large FOXIT_PREFIX(jpeg_free_large) #define jpeg_free_small FOXIT_PREFIX(jpeg_free_small) +#define jpeg_gen_optimal_table FOXIT_PREFIX(jpeg_gen_optimal_table) #define jpeg_get_large FOXIT_PREFIX(jpeg_get_large) #define jpeg_get_small FOXIT_PREFIX(jpeg_get_small) #define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans) @@ -58,6 +78,7 @@ #define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast) #define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow) #define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete) +#define jpeg_make_c_derived_tbl FOXIT_PREFIX(jpeg_make_c_derived_tbl) #define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl) #define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available) #define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init) @@ -65,18 +86,32 @@ #define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order) #define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap) #define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store) +#define jpeg_quality_scaling FOXIT_PREFIX(jpeg_quality_scaling) #define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients) #define jpeg_read_header FOXIT_PREFIX(jpeg_read_header) #define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data) #define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines) #define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart) #define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers) +#define jpeg_set_colorspace FOXIT_PREFIX(jpeg_set_colorspace) +#define jpeg_set_defaults FOXIT_PREFIX(jpeg_set_defaults) +#define jpeg_set_linear_quality FOXIT_PREFIX(jpeg_set_linear_quality) #define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor) +#define jpeg_set_quality FOXIT_PREFIX(jpeg_set_quality) +#define jpeg_simple_progression FOXIT_PREFIX(jpeg_simple_progression) +#define jpeg_start_compress FOXIT_PREFIX(jpeg_start_compress) #define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress) #define jpeg_start_output FOXIT_PREFIX(jpeg_start_output) #define jpeg_std_error FOXIT_PREFIX(jpeg_std_error) #define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table) #define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src) +#define jpeg_suppress_tables FOXIT_PREFIX(jpeg_suppress_tables) +#define jpeg_write_m_byte FOXIT_PREFIX(jpeg_write_m_byte) +#define jpeg_write_m_header FOXIT_PREFIX(jpeg_write_m_header) +#define jpeg_write_marker FOXIT_PREFIX(jpeg_write_marker) +#define jpeg_write_raw_data FOXIT_PREFIX(jpeg_write_raw_data) +#define jpeg_write_scanlines FOXIT_PREFIX(jpeg_write_scanlines) +#define jpeg_write_tables FOXIT_PREFIX(jpeg_write_tables) #define jround_up FOXIT_PREFIX(jround_up) #define jzero_far FOXIT_PREFIX(jzero_far) diff --git a/third_party/libjpeg/jpeglib.h b/third_party/libjpeg/jpeglib.h index 7de5ab726e..f6af4f2b47 100644 --- a/third_party/libjpeg/jpeglib.h +++ b/third_party/libjpeg/jpeglib.h @@ -20,33 +20,53 @@ #define jdiv_round_up FOXIT_PREFIX(jdiv_round_up) #define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer) #define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer) +#define jinit_c_coef_controller FOXIT_PREFIX(jinit_c_coef_controller) +#define jinit_c_main_controller FOXIT_PREFIX(jinit_c_main_controller) +#define jinit_c_master_control FOXIT_PREFIX(jinit_c_master_control) +#define jinit_c_prep_controller FOXIT_PREFIX(jinit_c_prep_controller) +#define jinit_color_converter FOXIT_PREFIX(jinit_color_converter) #define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter) +#define jinit_compress_master FOXIT_PREFIX(jinit_compress_master) #define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller) #define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller) #define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller) +#define jinit_downsampler FOXIT_PREFIX(jinit_downsampler) +#define jinit_forward_dct FOXIT_PREFIX(jinit_forward_dct) #define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder) +#define jinit_huff_encoder FOXIT_PREFIX(jinit_huff_encoder) #define jinit_input_controller FOXIT_PREFIX(jinit_input_controller) #define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct) #define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader) +#define jinit_marker_writer FOXIT_PREFIX(jinit_marker_writer) #define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress) #define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr) #define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler) #define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder) +#define jinit_phuff_encoder FOXIT_PREFIX(jinit_phuff_encoder) #define jinit_upsampler FOXIT_PREFIX(jinit_upsampler) +#define jpeg_CreateCompress FOXIT_PREFIX(jpeg_CreateCompress) #define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress) #define jpeg_abort FOXIT_PREFIX(jpeg_abort) +#define jpeg_abort_compress FOXIT_PREFIX(jpeg_abort_compress) #define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress) +#define jpeg_add_quant_table FOXIT_PREFIX(jpeg_add_quant_table) #define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table) #define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table) #define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions) #define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input) +#define jpeg_default_colorspace FOXIT_PREFIX(jpeg_default_colorspace) #define jpeg_destroy FOXIT_PREFIX(jpeg_destroy) +#define jpeg_destroy_compress FOXIT_PREFIX(jpeg_destroy_compress) #define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress) +#define jpeg_fdct_ifast FOXIT_PREFIX(jpeg_fdct_ifast) +#define jpeg_fdct_islow FOXIT_PREFIX(jpeg_fdct_islow) #define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer) +#define jpeg_finish_compress FOXIT_PREFIX(jpeg_finish_compress) #define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress) #define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output) #define jpeg_free_large FOXIT_PREFIX(jpeg_free_large) #define jpeg_free_small FOXIT_PREFIX(jpeg_free_small) +#define jpeg_gen_optimal_table FOXIT_PREFIX(jpeg_gen_optimal_table) #define jpeg_get_large FOXIT_PREFIX(jpeg_get_large) #define jpeg_get_small FOXIT_PREFIX(jpeg_get_small) #define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans) @@ -58,6 +78,7 @@ #define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast) #define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow) #define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete) +#define jpeg_make_c_derived_tbl FOXIT_PREFIX(jpeg_make_c_derived_tbl) #define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl) #define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available) #define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init) @@ -65,18 +86,32 @@ #define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order) #define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap) #define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store) +#define jpeg_quality_scaling FOXIT_PREFIX(jpeg_quality_scaling) #define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients) #define jpeg_read_header FOXIT_PREFIX(jpeg_read_header) #define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data) #define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines) #define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart) #define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers) +#define jpeg_set_colorspace FOXIT_PREFIX(jpeg_set_colorspace) +#define jpeg_set_defaults FOXIT_PREFIX(jpeg_set_defaults) +#define jpeg_set_linear_quality FOXIT_PREFIX(jpeg_set_linear_quality) #define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor) +#define jpeg_set_quality FOXIT_PREFIX(jpeg_set_quality) +#define jpeg_simple_progression FOXIT_PREFIX(jpeg_simple_progression) +#define jpeg_start_compress FOXIT_PREFIX(jpeg_start_compress) #define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress) #define jpeg_start_output FOXIT_PREFIX(jpeg_start_output) #define jpeg_std_error FOXIT_PREFIX(jpeg_std_error) #define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table) #define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src) +#define jpeg_suppress_tables FOXIT_PREFIX(jpeg_suppress_tables) +#define jpeg_write_m_byte FOXIT_PREFIX(jpeg_write_m_byte) +#define jpeg_write_m_header FOXIT_PREFIX(jpeg_write_m_header) +#define jpeg_write_marker FOXIT_PREFIX(jpeg_write_marker) +#define jpeg_write_raw_data FOXIT_PREFIX(jpeg_write_raw_data) +#define jpeg_write_scanlines FOXIT_PREFIX(jpeg_write_scanlines) +#define jpeg_write_tables FOXIT_PREFIX(jpeg_write_tables) #define jround_up FOXIT_PREFIX(jround_up) #define jzero_far FOXIT_PREFIX(jzero_far) -- cgit v1.2.3