Index: core/src/fxcodec/codec/fx_codec_jpeg.cpp |
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp |
index efd83f88ae5760b47a829bc1a9dd023450848e18..0a38fc82ca71c3c1396ed47c779b498ff63acd79 100644 |
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp |
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp |
@@ -426,7 +426,9 @@ FX_BOOL CCodec_JpegDecoder::Create(const uint8_t* src_buf, |
if ((int)cinfo.image_width < width) { |
return FALSE; |
} |
- m_Pitch = (cinfo.image_width * cinfo.num_components + 3) / 4 * 4; |
+ m_Pitch = |
+ (static_cast<FX_DWORD>(cinfo.image_width) * cinfo.num_components + 3) / |
+ 4 * 4; |
m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch); |
m_nComps = cinfo.num_components; |
m_bpc = 8; |
@@ -464,7 +466,7 @@ void CCodec_JpegDecoder::v_DownScale(int dest_width, int dest_height) { |
FX_GetDownsampleRatio(m_OrigWidth, m_OrigHeight, dest_width, dest_height); |
m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale; |
m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale; |
- m_Pitch = (m_OutputWidth * m_nComps + 3) / 4 * 4; |
+ m_Pitch = (static_cast<FX_DWORD>(m_OutputWidth) * m_nComps + 3) / 4 * 4; |
if (old_scale != m_DownScale) { |
m_NextLine = -1; |
} |