diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:22:56 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:22:56 -0800 |
commit | 78353d5dbc0b0c9b2d6946005439a51efa7d108c (patch) | |
tree | 2d0048714b8630cd22b2f8e3129318ed93ee945d /core/src/fxcodec/codec | |
parent | 711046ac7043ebeec2b0c9a5eb168418cd07a876 (diff) | |
download | pdfium-78353d5dbc0b0c9b2d6946005439a51efa7d108c.tar.xz |
Use safe arithmentic in CFX_BinaryBuf::ExpandBuf.
Always call ExpandBuf(), and if it returns, we know the
subsequent calculations won't overflow.
Also use std::unique_ptr, and fix unintentional copies thus
detected by its suppressed copy ctor in fsdk_baseform.cpp
Also Remove unused CFX_BinaryBuf::TakeOver(), AppendFill(), CopyData().
Also remove operator= in favor of using <<, for similarity
with std::ostream and friends.
Also move ByteStringC methods to CFX_ByteTextBuf sub-class.
Also re-order members, may pack tighter on 64-bits.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1710403002 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_fax.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp index cacbc71456..36b92f06ff 100644 --- a/core/src/fxcodec/codec/fx_codec_fax.cpp +++ b/core/src/fxcodec/codec/fx_codec_fax.cpp @@ -799,9 +799,8 @@ void CCodec_FaxEncoder::Encode(uint8_t*& dest_buf, FX_DWORD& dest_size) { if (dest_bitpos) { m_DestBuf.AppendByte(last_byte); } - dest_buf = m_DestBuf.GetBuffer(); dest_size = m_DestBuf.GetSize(); - m_DestBuf.DetachBuffer(); + dest_buf = m_DestBuf.DetachBuffer(); } FX_BOOL CCodec_FaxModule::Encode(const uint8_t* src_buf, int width, |