so, the debug version of my code works, but the release doesn't

0

like the title says, the debug version of my code works, but the release, doesnt, it just exits the program without doing nothing, if i put it in release mode and use debug, i get an exception thrown Unhandled exception at 0x00007FF6DA208CB0 in codec.exe: 0xC0000005: Access violation reading location 0x0000000000000008. and a big screen saying Symbol file not loaded, in my program i use malloc, because i needed an array of variable size, could that be the problem ?, in debug mode i have a warning named dereferencing null pointer, at the pointer i used malloc on //here's some code

        for (int j = 0; j < animation->servoTableSize.cols; j++)
    {
        // Analyze pixel change
        uint8_t* LocalMaximums = (uint8_t*)malloc((animation->servoFrameCount) * sizeof(uint8_t));
        //^^^ remembers the frames in which local maximums are
        int NumberOfSpikes = 0;
        //^^^remembers how many spikes there are


        //here we search for local spikes (local maximums)
        for (int FrameNumber = 0; FrameNumber < animation->servoFrameCount; FrameNumber++)
        {
            if (FrameNumber == 0
                && animation->servos[FrameNumber]->data[i][j] >= animation->servos[FrameNumber + 1]->data[i][j])
                //^^^if it's the first frame AND current value is higher or equal to the next value, then we have a new spike
                //we put the spike's frame in "Local Maximums",and increase the number of spikes
            {
                LocalMaximums[NumberOfSpikes] = FrameNumber;
                NumberOfSpikes++;
            }
visual-studio
debugging
malloc
release
asked on Stack Overflow Jan 26, 2021 by Moga Olimpiu • edited Jan 27, 2021 by Moga Olimpiu

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0