调整mips64导致崩溃问题

This commit is contained in:
luoliangyi 2022-05-05 18:04:20 +08:00
parent 1d5b8753af
commit b2d6ff3700
12 changed files with 16 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -51,7 +51,13 @@ G200Decode::G200Decode(std::shared_ptr<std::vector<char>> buff,bool is_duplex,bo
G400Decode::G400Decode(std::shared_ptr<std::vector<char>> buff,bool i) G400Decode::G400Decode(std::shared_ptr<std::vector<char>> buff,bool i)
{ {
printf("G400 :buff->size()=%d\r\n",buff->size()); /*std::shared_ptr<std::vector<char>> buf;
m_buffs.push_back(buff); buf.reset(new std::vector<char>);
auto bytes = buff->size();
buf->resize(bytes);
memcpy(buf->data(), buff->data(), bytes);
m_buffs.push_back(buf);*/
m_buffs.push_back(buff);
printf("G400 :buff->size()=%d\r\n",buff->size());
} }

View File

@ -80,7 +80,6 @@ namespace hg_imgproc
{ {
buffer_.reset(new std::vector<char >(*buff)); buffer_.reset(new std::vector<char >(*buff));
mats_.clear(); mats_.clear();
return HG_ERR_OK; return HG_ERR_OK;
} }
int load_file(const char* path_file) int load_file(const char* path_file)
@ -129,9 +128,11 @@ namespace hg_imgproc
if(buffs.empty()) if(buffs.empty())
return -1; return -1;
/////cmake当中进行定义 mips64 //在mips64下使用reset会导致崩溃 /////cmake当中进行定义 mips64 //在mips64下使用reset会导致崩溃
#ifndef mips64 //#ifndef mips64
buffer_.reset(); //printf("\n buffer_ reset");
#endif buffer_.reset(new std::vector<char >());
//printf("\n buffer_ reset");
//#endif
for (auto& buf : buffs) { for (auto& buf : buffs) {
cv::ImreadModes rmc = param_.channels > 1 ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE; cv::ImreadModes rmc = param_.channels > 1 ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE;
@ -182,9 +183,9 @@ namespace hg_imgproc
back.release(); back.release();
front.release(); front.release();
} }
#ifndef mips64 //#ifndef mips64
buffer_.reset(); buffer_.reset(new std::vector<char >());
#endif //#endif
} }
catch (const std::exception& e) catch (const std::exception& e)
{ {