summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/oned
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-11 16:26:00 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-11 16:26:00 -0800
commitf75bdb181576e4a4cf8291706a0db86c687e5fc3 (patch)
tree4440158d95c723b1ef02753b4dfa9d1a598e1a87 /xfa/src/fxbarcode/oned
parent74aa4e19a332436ff3bcf539c905e992b1d3ac4e (diff)
downloadpdfium-f75bdb181576e4a4cf8291706a0db86c687e5fc3.tar.xz
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 .
Diffstat (limited to 'xfa/src/fxbarcode/oned')
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp2
1 files changed, 1 insertions, 1 deletions
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++) {