From 76020fc9751e55661d1c01b6cd92dfcb1fd56e6a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 18 May 2017 15:51:20 -0700 Subject: Move CCodec_ModuleMgr ownership to CPDF_ModuleMgr. More straight forward than CFX_GEModule owning in and CPDF_ModuleMgr holding a pointer to it. Remove assumptions that the codec modules may return nullptr, and do IWYU. Change-Id: Iba7fc3c7ec223fd6d29a1ab74ed13d35689bc5d5 Reviewed-on: https://pdfium-review.googlesource.com/5654 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fxcodec/codec/fx_codec_progress.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'core/fxcodec') diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index 4cbae5cc75..84ab6a14c8 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -1068,10 +1068,6 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, } case FXCODEC_IMAGE_JPG: { CCodec_JpegModule* pJpegModule = m_pCodecMgr->GetJpegModule(); - if (!pJpegModule) { - m_status = FXCODEC_STATUS_ERR_MEMORY; - return false; - } m_pJpegContext = pJpegModule->Start(); if (!m_pJpegContext) { m_status = FXCODEC_STATUS_ERR_MEMORY; @@ -1873,9 +1869,9 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode( } switch (m_imagType) { case FXCODEC_IMAGE_JPG: { - CCodec_JpegModule* pJpegModule = m_pCodecMgr->GetJpegModule(); int down_scale = 1; GetDownScale(down_scale); + CCodec_JpegModule* pJpegModule = m_pCodecMgr->GetJpegModule(); bool bStart = pJpegModule->StartScanline(m_pJpegContext, down_scale); while (!bStart) { FXCODEC_STATUS error_status = FXCODEC_STATUS_ERROR; -- cgit v1.2.3