c ++ Queue Pop (): выброшено исключение: нарушение прав доступа на чтение. m было nullptr - PullRequest
0 голосов
/ 16 июня 2020

Данные заполняются без проблем. Но после выполнения операции pop 2-3 раза я получаю исключение: нарушение прав на чтение m было ошибкой nullptr. Как вы думаете, в чем причина?

    #define bufferSize 60   
    Mat frame1Current;
    vector<Mat> colorImages(4); 
    deque<Mat> frameQueue9001;

        Mat returnImage;

        string gst_pipe[] = {
        "udpsrc port=9001 caps = application/x-rtp ! rtph264depay ! h264parse ! nvh264dec ! videoconvert ! appsink sync=false"};

        void func1() {
            videoCap[0] = VideoCapture(gst_pipe[0], CAP_GSTREAMER);

            colorImages[0].create(Size(rsSplitWidth, rsSplitHeight), CV_8UC3);
            int i = 0;
            while (true)
            {
                videoCap[0].read(frame1Current);
                frameQueue9001.push_back(frame1Current.clone());

                if (frameQueue9001.size() > bufferSize)
                {
                    colorImages[0] = frameQueue9001.front();
                    frameQueue9001.pop_front();
                    checker9001 = true;
                    i++;
                }
            }
        }
...