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/datamatrix/BC_DataMatrixWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/src/fxbarcode/datamatrix') diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 25438f389a..d2f2507729 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -80,7 +80,7 @@ uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents, BC_EXCEPTION_CHECK_ReturnValue(e, NULL); outWidth = bytematrix->GetWidth(); outHeight = bytematrix->GetHeight(); - uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight); + uint8_t* result = FX_Alloc2D(uint8_t, outWidth, outHeight); FXSYS_memcpy(result, bytematrix->GetArray(), outWidth * outHeight); delete bytematrix; delete placement; -- cgit v1.2.3