summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp
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/pdf417/BC_PDF417DecodedBitStreamParser.cpp
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/pdf417/BC_PDF417DecodedBitStreamParser.cpp')
-rw-r--r--xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp
index af63d19bfe..ba822ce1d2 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp
@@ -360,7 +360,7 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode,
if (mode == BYTE_COMPACTION_MODE_LATCH) {
int32_t count = 0;
int64_t value = 0;
- FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD));
+ FX_WORD* decodedData = FX_Alloc(FX_WORD, 6);
CFX_Int32Array byteCompactedCodewords;
byteCompactedCodewords.SetSize(6);
FX_BOOL end = FALSE;
@@ -421,7 +421,7 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode,
}
}
if ((count % 5 == 0) && (count > 0)) {
- FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD));
+ FX_WORD* decodedData = FX_Alloc(FX_WORD, 6);
int32_t j = 0;
for (; j < 6; ++j) {
decodedData[5 - j] = (FX_WORD)(value & 0xFF);