From f75bdb181576e4a4cf8291706a0db86c687e5fc3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 11 Dec 2015 16:26:00 -0800 Subject: XFA: avoid multiplications in FX_Allocs In some cases, we can use the safe FX_Alloc2D, in others there's an extra multiplication by the size of the type. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1519233002 . --- xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/src/fxbarcode/oned') diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp index eef810ac44..a2e27faff8 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp @@ -159,7 +159,7 @@ uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, CBC_OnedCodaBarReader CodaBarR; CFX_ByteString data = m_chStart + contents + m_chEnd; m_iContentLen = data.GetLength(); - uint8_t* result = FX_Alloc(uint8_t, m_iWideNarrRatio * 7 * data.GetLength()); + uint8_t* result = FX_Alloc2D(uint8_t, m_iWideNarrRatio * 7, data.GetLength()); FX_CHAR ch; int32_t position = 0; for (int32_t index = 0; index < data.GetLength(); index++) { -- cgit v1.2.3