Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: core/src/fxcodec/codec/fx_codec_fax.cpp

Issue 1710403002: Use safe arithmentic in CFX_BinaryBuf::ExpandBuf. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Unique_ptr, safe arithmetic. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxcodec/codec/fx_codec_fax.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp
index cacbc714561f06f8c42b4f9645446b72d3271b95..36b92f06ffbb3f597a299fb592e74b7d903e39fb 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,

Powered by Google App Engine
This is Rietveld 408576698