1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

ts: fix callback function signature

detected by UBSAN
This commit is contained in:
Alexander Alekhin
2019-08-29 14:37:35 +03:00
parent 8d0b3dad5c
commit 654d0c29ad
+2 -1
View File
@@ -512,8 +512,9 @@ string TS::str_from_code( const TS::FailureCode code )
return "Generic/Unknown";
}
static int tsErrorCallback( int status, const char* func_name, const char* err_msg, const char* file_name, int line, TS* ts )
static int tsErrorCallback( int status, const char* func_name, const char* err_msg, const char* file_name, int line, void* data )
{
TS* ts = (TS*)data;
const char* delim = std::string(err_msg).find('\n') == std::string::npos ? "" : "\n";
ts->printf(TS::LOG, "OpenCV Error:\n\t%s (%s%s) in %s, file %s, line %d\n", cvErrorStr(status), delim, err_msg, func_name[0] != 0 ? func_name : "unknown function", file_name, line);
return 0;