<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; :4.1:</li>
<li>Operating System / Platform =&gt; :Ubuntu 19.04 64 Bit:</li>
<li>Compiler =&gt; :g++ 4.8.2</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">I try to initialiaze a variable in order to compute the BRISQUE descriptor and I received the error message:</p>
<p dir="auto">terminate called after throwing an instance of 'std::logic_error'<br>
what():  basic_string::_S_construct null not valid<br>
Aborted (core dumped)</p>
<h5 dir="auto">Steps to reproduce</h5>

<details>
General configuration for OpenCV 4.1.0 =====================================
  Version control:               4.1.0
<p dir="auto">Extra modules:<br>
Location (extra):            /io/opencv_contrib/modules<br>
Version control (extra):     4.1.0</p>
<p dir="auto">Platform:<br>
Timestamp:                   2019-04-11T17:07:54Z<br>
Host:                        Linux 4.4.0-101-generic x86_64<br>
CMake:                       3.9.0<br>
CMake generator:             Unix Makefiles<br>
CMake build tool:            /usr/bin/gmake<br>
Configuration:               Release</p>
<p dir="auto">CPU/HW features:<br>
Baseline:                    SSE SSE2 SSE3<br>
requested:                 SSE3<br>
Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2<br>
requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX<br>
SSE4_1 (13 files):         + SSSE3 SSE4_1<br>
SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2<br>
FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX<br>
AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX<br>
AVX2 (27 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2</p>
<p dir="auto">C/C++:<br>
Built as dynamic libs?:      NO<br>
C++ Compiler:                /usr/lib/ccache/compilers/c++  (ver 4.8.2)<br>
C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG<br>
C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG<br>
C Compiler:                  /usr/lib/ccache/compilers/cc<br>
C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG<br>
C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG<br>
Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections<br>
Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections<br>
ccache:                      YES<br>
Precompiled headers:         NO<br>
Extra dependencies:          ade /opt/Qt4.8.7/lib/libQtGui.so /opt/Qt4.8.7/lib/libQtTest.so /opt/Qt4.8.7/lib/libQtCore.so /lib64/libz.so /opt/libjpeg-turbo/lib64/libjpeg.a dl m pthread rt<br>
3rdparty dependencies:       ittnotify libprotobuf libwebp libpng libtiff libjasper IlmImf quirc</p>
<p dir="auto">OpenCV modules:<br>
To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto<br>
Disabled:                    world<br>
Disabled by dependency:      -<br>
Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java js matlab ovis python2 sfm ts viz<br>
Applications:                -<br>
Documentation:               NO<br>
Non-free algorithms:         NO</p>
<p dir="auto">GUI:<br>
QT:                          YES (ver 4.8.7 EDITION = OpenSource)<br>
QT OpenGL support:         NO<br>
GTK+:                        NO<br>
VTK support:                 NO</p>
<p dir="auto">Media I/O:<br>
ZLib:                        /lib64/libz.so (ver 1.2.3)<br>
JPEG:                        /opt/libjpeg-turbo/lib64/libjpeg.a (ver 62)<br>
WEBP:                        build (ver encoder: 0x020e)<br>
PNG:                         build (ver 1.6.36)<br>
TIFF:                        build (ver 42 - 4.0.10)<br>
JPEG 2000:                   build (ver 1.900.1)<br>
OpenEXR:                     build (ver 1.7.1)<br>
HDR:                         YES<br>
SUNRASTER:                   YES<br>
PXM:                         YES<br>
PFM:                         YES</p>
<p dir="auto">Video I/O:<br>
DC1394:                      NO<br>
FFMPEG:                      YES<br>
avcodec:                   YES (58.47.106)<br>
avformat:                  YES (58.26.101)<br>
avutil:                    YES (56.26.100)<br>
swscale:                   YES (5.4.100)<br>
avresample:                NO<br>
GStreamer:                   NO<br>
v4l/v4l2:                    YES (linux/videodev2.h)</p>
<p dir="auto">Parallel framework:            pthreads</p>
<p dir="auto">Trace:                         YES (with Intel ITT)</p>
<p dir="auto">Other third-party libraries:<br>
Lapack:                      NO<br>
Eigen:                       NO<br>
Custom HAL:                  NO<br>
Protobuf:                    build (3.5.1)</p>
<p dir="auto">OpenCL:                        YES (no extra features)<br>
Include path:                /io/opencv/3rdparty/include/opencl/1.2<br>
Link libraries:              Dynamic load</p>
<p dir="auto">Python 3:<br>
Interpreter:                 /opt/python/cp36-cp36m/bin/python (ver 3.6.8)<br>
Libraries:                   libpython3.6m.a (ver 3.6.8)<br>
numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.11.3)<br>
install path:                python</p>
<p dir="auto">Python (for build):            /opt/python/cp36-cp36m/bin/python</p>
<p dir="auto">Java:<br>
ant:                         NO<br>
JNI:                         NO<br>
Java wrappers:               NO<br>
Java tests:                  NO</p>
</details>
<p dir="auto">Hello,</p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.0</li>
<li>Operating System / Platform =&gt; Windows 10 64 bit</li>
<li>Compiler =&gt; mingw-w64 GCC 8.1.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">The use of <em>strcpy_s</em> and <em>strcat_s</em> in <em>window_w32.cpp</em> makes OpenCV impossible to build with GCC (on Windows) which doesn't have the optional <em>_s</em> functions from C11. I'm not an expert in C/C++ so I would suggest to replace the use of the above with <em>strncpy</em> and <em>strncat</em> which should be present in all compilers (MSVC, GCC, Clang).</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Try to build OpenCV 4.0 beta with mingw-w64 GCC 8.1 on Windows.</p>
<p dir="auto">Thanks.</p>