title: I get the Assertion failure "file_name != nullptr" but only in release mode
body: <p>When I try to run the code in debug mode everything works fine, but when I try to run it in release mode I get the error "file_name != nullptr"(the error comes from fopen). I know what the error means, but I don't know why I get the error and how to fix it</p>
  
  <pre><code>#include &lt;opencv2/core.hpp&gt;
  #include &lt;opencv2/imgcodecs.hpp&gt;
  #include &lt;opencv2/highgui.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace cv;
  using namespace std;
  int main(int argc, char** argv)
  {
      String imageName("C:/Users/x/Desktop/pic.png"); // by default
      if (argc &gt; 1)
      {
          imageName = argv[1];
      }
  
      Mat image;
      image = imread(imageName, IMREAD_COLOR); // Read the file
  
      if (image.empty())                      // Check for invalid input
      {
          cout &lt;&lt; "Could not open or find the image" &lt;&lt; std::endl;
          return -1;
      }
  
      namedWindow("Display window", WINDOW_AUTOSIZE); // Create a window for display.
      imshow("Display window", image);                // Show our image inside it.
      waitKey(0); // Wait for a keystroke in the window
      return 0;
  }
  </code></pre>
  
  <p>Error Message:</p>
  
  <pre><code>&gt;-----------Microsoft Visual C++ Runtime Library----------------
  &gt;
  &gt;
  &gt;Debug Assertion Assertion Faild!
  &gt;
  &gt;Programm: C:\Users\x\...\myProgramm.exe
  &gt;File: minkernel\crts\ucrt\src\appcrt\stdio\fopen.cpp
  &gt;
  &gt;Line: 30
  &gt;
  &gt;Expression: file_name != nullptr
  </code></pre>