| Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
 | 
| diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
 | 
| index 2fbecad3510deeacff89ef791723742f3ca62ca2..21ce31e3c37f01ce446cfdf4b1b8ec97ea0a6f02 100644
 | 
| --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
 | 
| +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
 | 
| @@ -12,7 +12,11 @@
 | 
|  #include "../fpdf_render/render_int.h"
 | 
|  CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size)
 | 
|  {
 | 
| -    int32_t width, height, color_trans, num_comps, bits;
 | 
| +    int32_t width;
 | 
| +    int32_t height;
 | 
| +    int32_t num_comps;
 | 
| +    int32_t bits;
 | 
| +    bool color_trans;
 | 
|      if (!CPDF_ModuleMgr::Get()->GetJpegModule()->
 | 
|              LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) {
 | 
|          return NULL;
 | 
| @@ -44,7 +48,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size)
 | 
|          pDict->SetAt("DecodeParms", pParms);
 | 
|          pParms->SetAtInteger("ColorTransform", 0);
 | 
|      }
 | 
| -    m_bIsMask = FALSE;
 | 
| +    m_bIsMask = false;
 | 
|      m_Width = width;
 | 
|      m_Height = height;
 | 
|      if (m_pStream == NULL) {
 | 
| @@ -88,7 +92,7 @@ void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
 | 
|  void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, uint8_t* &buf, FX_STRSIZE &size)
 | 
|  {
 | 
|  }
 | 
| -void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
 | 
| +void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, bool bLossLess)
 | 
|  {
 | 
|  }
 | 
|  void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam)
 | 
| @@ -101,7 +105,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|      uint8_t* src_buf = pBitmap->GetBuffer();
 | 
|      int32_t src_pitch = pBitmap->GetPitch();
 | 
|      int32_t bpp = pBitmap->GetBPP();
 | 
| -    FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
 | 
| +    bool bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
 | 
|      CPDF_Dictionary* pDict = new CPDF_Dictionary;
 | 
|      pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
 | 
|      pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
 | 
| @@ -117,7 +121,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|              ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
 | 
|          }
 | 
|          if (set_a == 0 || reset_a == 0) {
 | 
| -            pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(TRUE));
 | 
| +            pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(true));
 | 
|              if (reset_a == 0) {
 | 
|                  CPDF_Array* pArray = new CPDF_Array;
 | 
|                  pArray->AddInteger(1);
 | 
| @@ -138,7 +142,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|              pBuf[4] = (FX_CHAR)set_g;
 | 
|              pBuf[5] = (FX_CHAR)set_b;
 | 
|              ct.ReleaseBuffer(6);
 | 
| -            pCS->Add(CPDF_String::Create(ct, TRUE));
 | 
| +            pCS->Add(CPDF_String::Create(ct, true));
 | 
|              pDict->SetAt(FX_BSTRC("ColorSpace"), pCS);
 | 
|          }
 | 
|          pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1);
 | 
| @@ -190,10 +194,10 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|          }
 | 
|      }
 | 
|      const CFX_DIBitmap* pMaskBitmap = NULL;
 | 
| -    FX_BOOL bDeleteMask = FALSE;
 | 
| +    bool bDeleteMask = false;
 | 
|      if (pBitmap->HasAlpha()) {
 | 
|          pMaskBitmap = pBitmap->GetAlphaMask();
 | 
| -        bDeleteMask = TRUE;
 | 
| +        bDeleteMask = true;
 | 
|      }
 | 
|      if (!pMaskBitmap && pMask) {
 | 
|          FXDIB_Format maskFormat = pMask->GetFormat();
 | 
| @@ -216,7 +220,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|          if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMPRESS) != 0) {
 | 
|              _DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality : 75, mask_buf, mask_size);
 | 
|          } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) {
 | 
| -            _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, TRUE);
 | 
| +            _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, true);
 | 
|          } else {
 | 
|              mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth);
 | 
|              mask_size = maskHeight * maskWidth;  // Safe since checked alloc returned.
 | 
| @@ -241,15 +245,15 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
 | 
|              delete pMaskBitmap;
 | 
|          }
 | 
|      }
 | 
| -    FX_BOOL bStream = pFileWrite != NULL && pFileRead != NULL;
 | 
| +    bool bStream = pFileWrite != NULL && pFileRead != NULL;
 | 
|      if (opType == 0) {
 | 
|          if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) {
 | 
|              if (pBitmap->GetBPP() == 1) {
 | 
| -                _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, TRUE);
 | 
| +                _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, true);
 | 
|              }
 | 
|          } else {
 | 
|              if (pBitmap->GetBPP() == 1) {
 | 
| -                _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, FALSE);
 | 
| +                _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, false);
 | 
|              } else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL) {
 | 
|                  CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap();
 | 
|                  pNewBitmap->Copy(pBitmap);
 | 
| 
 |