diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-12-11 16:26:00 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-12-11 16:26:00 -0800 |
commit | f75bdb181576e4a4cf8291706a0db86c687e5fc3 (patch) | |
tree | 4440158d95c723b1ef02753b4dfa9d1a598e1a87 /xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp | |
parent | 74aa4e19a332436ff3bcf539c905e992b1d3ac4e (diff) | |
download | pdfium-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_PDF417Writer.cpp')
-rw-r--r-- | xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp index 457b30b750..d922889b3d 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -97,7 +97,7 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, outWidth = temp;
}
}
- uint8_t* result = (uint8_t*)FX_Alloc(uint8_t, outHeight * outWidth);
+ uint8_t* result = FX_Alloc2D(uint8_t, outHeight, outWidth);
FXSYS_memcpy(result, originalScale.GetData(), outHeight * outWidth);
return result;
}
|