summaryrefslogtreecommitdiff
path: root/fxbarcode
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode')
-rw-r--r--fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp6
-rw-r--r--fxbarcode/common/reedsolomon/BC_ReedSolomon.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index ca65f72043..2be74c7fa3 100644
--- a/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
+++ b/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -36,7 +36,7 @@ CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder() {}
void CBC_ReedSolomonEncoder::Init() {
m_cachedGenerators.push_back(
- pdfium::MakeUnique<CBC_ReedSolomonGF256Poly>(m_field, 1));
+ pdfium::MakeUnique<CBC_ReedSolomonGF256Poly>(m_field.Get(), 1));
}
CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(
@@ -46,7 +46,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(
for (size_t d = m_cachedGenerators.size(); d <= degree; ++d) {
std::vector<int32_t> temp = {1, m_field->Exp(d - 1)};
CBC_ReedSolomonGF256Poly temp_poly;
- if (!temp_poly.Init(m_field, &temp))
+ if (!temp_poly.Init(m_field.Get(), &temp))
return nullptr;
auto nextGenerator = lastGenerator->Multiply(&temp_poly);
@@ -78,7 +78,7 @@ bool CBC_ReedSolomonEncoder::Encode(std::vector<int32_t>* toEncode,
infoCoefficients[x] = (*toEncode)[x];
CBC_ReedSolomonGF256Poly info;
- if (!info.Init(m_field, &infoCoefficients))
+ if (!info.Init(m_field.Get(), &infoCoefficients))
return false;
auto infoTemp = info.MultiplyByMonomial(ecBytes, 1);
diff --git a/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
index 68d4ee0624..2838e13cee 100644
--- a/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
+++ b/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
@@ -26,7 +26,7 @@ class CBC_ReedSolomonEncoder {
private:
CBC_ReedSolomonGF256Poly* BuildGenerator(size_t degree);
- CBC_ReedSolomonGF256* const m_field;
+ CFX_UnownedPtr<CBC_ReedSolomonGF256> const m_field;
std::vector<std::unique_ptr<CBC_ReedSolomonGF256Poly>> m_cachedGenerators;
};