From 660843f9ea0e75b4efc78d17bbc5661c2d3ea2be Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 10 May 2018 19:11:37 +0000 Subject: Clean up post review comments Cleaning up some nits that came in after my previous codec CL had gone into the CQ. BUG=pdfium:1080 Change-Id: I3845136d370f73c9c96ef732e95b8cf0c9c79d91 Reviewed-on: https://pdfium-review.googlesource.com/32351 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- core/fxcodec/codec/ccodec_progressivedecoder.h | 2 +- core/fxcodec/codec/fx_codec.cpp | 17 +---------------- core/fxcodec/codec/fx_codec_progress.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 21 deletions(-) (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index 4eeb59d559..979de6ed25 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -244,13 +244,13 @@ class CCodec_ProgressiveDecoder : RetainPtr m_pFile; RetainPtr m_pDeviceBitmap; UnownedPtr m_pCodecMgr; + std::unique_ptr m_pJpegContext; #ifdef PDF_ENABLE_XFA_BMP std::unique_ptr m_pBmpContext; #endif // PDF_ENABLE_XFA_BMP #ifdef PDF_ENABLE_XFA_GIF std::unique_ptr m_pGifContext; #endif // PDF_ENABLE_XFA_GIF - std::unique_ptr m_pJpegContext; #ifdef PDF_ENABLE_XFA_PNG std::unique_ptr m_pPngContext; #endif // PDF_ENABLE_XFA_PNG diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index d81e8f756c..54245a5b99 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -1509,22 +1509,7 @@ bool CCodec_BasicModule::A85Encode(const uint8_t* src_buf, } #ifdef PDF_ENABLE_XFA -CFX_DIBAttribute::CFX_DIBAttribute() - : -#ifdef PDF_ENABLE_XFA_BMP - m_nBmpCompressType(0), -#endif // PDF_ENABLE_BMP -#ifdef PDF_ENABLE_XFA_GIF - m_nGifLeft(0), - m_nGifTop(0), - m_pGifLocalPalette(nullptr), - m_nGifLocalPalNum(0), -#endif // PDF_ENABLE_XFA_GIF - m_nXDPI(-1), - m_nYDPI(-1), - m_fAspectRatio(-1.0f), - m_wDPIUnit(0) { -} +CFX_DIBAttribute::CFX_DIBAttribute() {} CFX_DIBAttribute::~CFX_DIBAttribute() { for (const auto& pair : m_Exif) diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index e45dff6682..6b91e864ab 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -1737,6 +1737,8 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, memset(m_pSrcBuf, 0, size); m_SrcSize = size; switch (imageType) { + case FXCODEC_IMAGE_JPG: + return JpegDetectImageType(pAttribute, size); #ifdef PDF_ENABLE_XFA_BMP case FXCODEC_IMAGE_BMP: return BmpDetectImageType(pAttribute, size); @@ -1745,8 +1747,6 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, case FXCODEC_IMAGE_GIF: return GifDetectImageType(pAttribute, size); #endif // PDF_ENABLE_XFA_GIF - case FXCODEC_IMAGE_JPG: - return JpegDetectImageType(pAttribute, size); #ifdef PDF_ENABLE_XFA_PNG case FXCODEC_IMAGE_PNG: return PngDetectImageType(pAttribute, size); @@ -2444,6 +2444,8 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() { return FXCODEC_STATUS_ERROR; switch (m_imagType) { + case FXCODEC_IMAGE_JPG: + return JpegContinueDecode(); #ifdef PDF_ENABLE_XFA_BMP case FXCODEC_IMAGE_BMP: return BmpContinueDecode(); @@ -2452,8 +2454,6 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() { case FXCODEC_IMAGE_GIF: return GifContinueDecode(); #endif // PDF_ENABLE_XFA_GIF - case FXCODEC_IMAGE_JPG: - return JpegContinueDecode(); #ifdef PDF_ENABLE_XFA_PNG case FXCODEC_IMAGE_PNG: return PngContinueDecode(); -- cgit v1.2.3