diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-09-25 20:06:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-25 20:06:50 +0000 |
commit | 30dc6aaf878b2c55efcf7598fdb8886e06d14e01 (patch) | |
tree | 2de58de8c2eddd4efb5dc8a8c5b54cd3faad4972 /core/fxcrt/cfx_bitstream.cpp | |
parent | 958142efa4561b5efd52733ad6c3b889cf49b3ae (diff) | |
download | pdfium-30dc6aaf878b2c55efcf7598fdb8886e06d14e01.tar.xz |
Add FxAlignToBoundary<>() template helper function.
Because I nearly botched this trivial calculation in the previous CL.
Change-Id: I7438f9d3476d93b7899c2d7d761234769f53f9e3
Reviewed-on: https://pdfium-review.googlesource.com/43010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_bitstream.cpp')
-rw-r--r-- | core/fxcrt/cfx_bitstream.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxcrt/cfx_bitstream.cpp b/core/fxcrt/cfx_bitstream.cpp index 3d3040d96a..d16fc2f1a4 100644 --- a/core/fxcrt/cfx_bitstream.cpp +++ b/core/fxcrt/cfx_bitstream.cpp @@ -8,6 +8,7 @@ #include <limits> +#include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_system.h" CFX_BitStream::CFX_BitStream(pdfium::span<const uint8_t> pData) @@ -18,7 +19,7 @@ CFX_BitStream::CFX_BitStream(pdfium::span<const uint8_t> pData) CFX_BitStream::~CFX_BitStream() {} void CFX_BitStream::ByteAlign() { - m_BitPos = (m_BitPos + 7) & ~7; + m_BitPos = FxAlignToBoundary<8>(m_BitPos); } uint32_t CFX_BitStream::GetBits(uint32_t nBits) { |