I've been trying to use cv::VideoCapture:: open("< path to video file >") in QtCreator (opencv added). Even though the program runs without errors in "bebug mode" (debug build), it gives below runtime error in "release mode" (release build).

Debug Assertion Failed File: f:/dd/vctools/crt_bld/self_x86/src/isctype.c Line: 56 Expression: (unsigned)(c+1) <= 256
It is a simple program which uses only cv::VideoCapture:: open() [for testing purposes]

Below is the .pro file

Qt Code:
  1. QT += core gui
  2.  
  3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  4. TARGET = untitled
  5. TEMPLATE = app
  6. SOURCES += main.cpp\
  7. mainwindow.cpp
  8. HEADERS += mainwindow.h
  9. FORMS += mainwindow.ui
  10.  
  11. INCLUDEPATH += C:/C/opencv/build/include
  12. INCLUDEPATH += C:/C/opencv/build/include/opencv
  13.  
  14. LIBS += C:/C/opencv/build/x86/vc10/lib/opencv_highgui240d.lib
  15. LIBS += C:/C/opencv/build/x86/vc10/lib/opencv_highgui240.lib
  16.  
  17.  
  18. LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240d.dll
  19. LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240.dll
To copy to clipboard, switch view to plain text mode 

Below is the Header file

Qt Code:
  1. #include <QMainWindow>
  2. #include <opencv2/highgui/highgui.hpp>
  3. #include <opencv2/core/core.hpp>
  4.  
  5. namespace Ui {
  6. class MainWindow;
  7. }
  8.  
  9. class MainWindow : public QMainWindow
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. explicit MainWindow(QWidget *parent = 0);
  15. ~MainWindow();
  16.  
  17. private:
  18. Ui::MainWindow *ui;
  19. cv::VideoCapture vcap;
  20. };
To copy to clipboard, switch view to plain text mode 

Below is the .cpp file

Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5. QMainWindow(parent),
  6. ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. vcap.open("C:/Users/ANURUDDHA/pedestrians/ThreePastShop2cor.mpg");
  10. }
  11.  
  12. MainWindow::~MainWindow()
  13. {
  14. delete ui;
  15. }
To copy to clipboard, switch view to plain text mode 

When I pass an int as the argument to cv::VideoCapture:: open() [eg: vcap.open(0)] it runs without errors in both debug and release build and opens webcam successfully. Problem comes only when I pass a String to arguments.

Someone please shed some light on this. Really appreciated.