Skip to content

Commit d75a1c3

Browse files
committed
Two simple fixes to We Char QR Code module:
- decodemgr.cpp: fix messed: width <--> height - unicomblock.cpp: fix wrong type at sizeof(...)
1 parent bf95e79 commit d75a1c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/wechat_qrcode/src/decodermgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int DecoderMgr::decodeImage(cv::Mat src, bool use_nn_detector, vector<string>& r
3333
decode_hints_.setUseNNDetector(use_nn_detector);
3434

3535
Ref<ImgSource> source;
36-
qbarUicomBlock_ = new UnicomBlock(width, height);
36+
qbarUicomBlock_ = new UnicomBlock(height, width);
3737

3838
// Four Binarizers
3939
int tryBinarizeTime = 4;
@@ -89,4 +89,4 @@ vector<Ref<Result>> DecoderMgr::Decode(Ref<BinaryBitmap> image, DecodeHints hint
8989
return reader_->decode(image, hints);
9090
}
9191
} // namespace wechat_qrcode
92-
} // namespace cv
92+
} // namespace cv

modules/wechat_qrcode/src/zxing/common/unicomblock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void UnicomBlock::Init() {
2626

2727
void UnicomBlock::Reset(Ref<BitMatrix> poImage) {
2828
m_poImage = poImage;
29-
memset(&m_vcIndex[0], 0, m_vcIndex.size() * sizeof(short));
29+
memset(&m_vcIndex[0], 0, m_vcIndex.size() * sizeof(m_vcIndex[0]));
3030
m_iNowIdx = 0;
3131
}
3232

0 commit comments

Comments
 (0)