diff options
Diffstat (limited to 'core/fxcodec')
-rw-r--r-- | core/fxcodec/codec/ccodec_faxmodule.cpp | 2 | ||||
-rw-r--r-- | core/fxcodec/codec/ccodec_progressivedecoder.cpp | 8 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_Image.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/core/fxcodec/codec/ccodec_faxmodule.cpp b/core/fxcodec/codec/ccodec_faxmodule.cpp index 423dfe6857..fe9f6a9e2e 100644 --- a/core/fxcodec/codec/ccodec_faxmodule.cpp +++ b/core/fxcodec/codec/ccodec_faxmodule.cpp @@ -530,7 +530,7 @@ uint8_t* CCodec_FaxDecoder::v_GetNextLine() { if (m_bByteAlign && m_bitpos < bitsize) { int bitpos0 = m_bitpos; - int bitpos1 = (m_bitpos + 7) / 8 * 8; + int bitpos1 = FxAlignToBoundary<8>(m_bitpos); while (m_bByteAlign && bitpos0 < bitpos1) { int bit = m_SrcSpan[bitpos0 / 8] & (1 << (7 - bitpos0 % 8)); if (bit != 0) diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.cpp b/core/fxcodec/codec/ccodec_progressivedecoder.cpp index c2d121d35a..16408a2b6a 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.cpp +++ b/core/fxcodec/codec/ccodec_progressivedecoder.cpp @@ -839,7 +839,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::BmpStartDecode( return m_status; } GetTransMethod(m_pDeviceBitmap->GetFormat(), m_SrcFormat); - m_ScanlineSize = (m_SrcWidth * m_SrcComponents + 3) / 4 * 4; + m_ScanlineSize = FxAlignToBoundary<4>(m_SrcWidth * m_SrcComponents); m_pDecodeBuf.reset(FX_Alloc(uint8_t, m_ScanlineSize)); memset(m_pDecodeBuf.get(), 0, m_ScanlineSize); m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0, @@ -971,7 +971,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::GifStartDecode( } m_SrcFormat = FXCodec_8bppRgb; GetTransMethod(m_pDeviceBitmap->GetFormat(), m_SrcFormat); - int scanline_size = (m_SrcWidth + 3) / 4 * 4; + int scanline_size = FxAlignToBoundary<4>(m_SrcWidth); m_pDecodeBuf.reset(FX_Alloc(uint8_t, scanline_size)); memset(m_pDecodeBuf.get(), 0, scanline_size); m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0, @@ -1211,7 +1211,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::JpegStartDecode( startStatus = pJpegModule->StartScanline(m_pJpegContext.get(), down_scale); } int scanline_size = (m_SrcWidth + down_scale - 1) / down_scale; - scanline_size = (scanline_size * m_SrcComponents + 3) / 4 * 4; + scanline_size = FxAlignToBoundary<4>(scanline_size * m_SrcComponents); m_pDecodeBuf.reset(FX_Alloc(uint8_t, scanline_size)); memset(m_pDecodeBuf.get(), 0, scanline_size); m_WeightHorz.Calc(m_sizeX, 0, m_sizeX, m_clipBox.Width(), 0, @@ -1435,7 +1435,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::PngStartDecode( } } GetTransMethod(m_pDeviceBitmap->GetFormat(), m_SrcFormat); - int scanline_size = (m_SrcWidth * m_SrcComponents + 3) / 4 * 4; + int scanline_size = FxAlignToBoundary<4>(m_SrcWidth * m_SrcComponents); m_pDecodeBuf.reset(FX_Alloc(uint8_t, scanline_size)); memset(m_pDecodeBuf.get(), 0, scanline_size); m_WeightHorzOO.Calc(m_sizeX, m_clipBox.Width()); diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp index 1194b1a402..a2d9f486e1 100644 --- a/core/fxcodec/jbig2/JBig2_Image.cpp +++ b/core/fxcodec/jbig2/JBig2_Image.cpp @@ -44,7 +44,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h) { if (w <= 0 || h <= 0 || w > kMaxImagePixels) return; - int32_t stride_pixels = (w + 31) & ~31; + int32_t stride_pixels = FxAlignToBoundary<32>(w); if (h > kMaxImagePixels / stride_pixels) return; |