| 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 c06253d785a50ff0bef9743e47637718b01b0e04..b59deb5a0d5452c434f2d7ff47e56603dc9b484b 100644
|
| --- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
|
| +++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
|
| @@ -427,7 +427,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;
|
| @@ -461,7 +463,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;
|
| }
|
|
|