@Jason Ball this is the whole function:
std::ifstream InFile(filename);
if (!InFile)
    return E_FAIL;
std::vector<Layer>Layers;
std::vector<PatternSet>Patterns;
std::vector<Mood>Moods;
Layer layer;
PatternSet ps;
Mood mood;
Theme theme;
layer.fileInfo.padding = layer.fileInfo.data = nullptr;
layer.fileInfo.len = 0;
std::string cmd;
while (true)
{
    InFile >> cmd;
    if (!InFile)
        break;
    if (cmd == "f")
    {
        InFile >> layer.fileInfo.filename;
    }
    else if (cmd == "fp")
    {
        int data, n; InFile >> n;
        for (int a = 0; a < n; a++)
        {
            InFile >> data;
            layer.fadePoints.push_back(data);
        }
    }
    else if (cmd == "sp")
    {
        int data, n; InFile >> n;
        for (int a = 0; a < n; a++)
        {
            InFile >> data;
            layer.syncPoints.push_back(data);
        }
    }
    else if (cmd == "v")
    {
        InFile >> layer.volume;
    }
    else if (cmd == "#layerend")
    {
        Layers.push_back(layer);
    }
    else if (cmd == "#patternset")
    {
        int Index;
        for (int a = 0; a < 5; a++)
        {
            InFile >> Index;
            if (Index != -1)
                ps.pattern[a] = std::move(Layers[Index]);
        }
        Patterns.push_back(ps);
        memset(ps.pattern, 0, sizeof(Layer)* 5);
    }
    else if (cmd == "#mood")
    {
        InFile >> mood.name;
        int Index, n; InFile >> n;
        for (int a = 0; a < n; a++)
        {
            InFile >> Index;
            mood.data.push_back(Patterns[Index]);
        }
        Moods.push_back(mood);
        mood.data.clear();
    }
    else if (cmd == "#theme")
    {
        InFile >> theme.name;
        int Index, n; InFile >> n;
        for (int a = 0; a < n; a++)
        {
            InFile >> Index;
            theme.data.push_back(Moods[Index]);
        }
        m_vTheme.push_back(theme);
        theme.data.clear();
    }
    else
    {
    }
}
return S_OK;
and here is a file:
#layer
f filename
fp 4 0 1998 1245 1003482
sp 3 500 1200 9500
v 0.95
#layerend
#layer
f filename2
fp 4 0 1998 1245 1003482
sp 3 500 1200 9500
v 0.75
#layerend
#patternset -1 0 -1 -1 -1
#patternset -1 1 -1 -1 -1
#mood name n 0 1
#theme name n 0
@Jason Ball here you have those structures as well:
struct node
{
    union{
        struct{
            std::string filename;
            void *padding;
        };
        struct{
            void *data;
            unsigned int len;
        };
    };
};
struct Theme;
struct Mood;
struct PatternSet;
struct Layer
{
    node fileInfo;
    std::vector<int> fadePoints;
    std::vector<int> syncPoints;
    float volume;
    PatternSet *pUp;
};
struct PatternSet
{
    union{
        struct{
            Layer pattern[5];
        };
        struct{
            Layer start;
            Layer main;
            Layer end;
            Layer rhytmic;
            Layer incidental;
        };
    };
    Mood *pUp;
};
struct Mood
{
    std::vector<PatternSet> data;
    std::string name;
    Theme *pUp;
};
struct Theme
{
    std::vector<Mood> data;
    std::string name;
};
When I set breakpoints everywhere, it shows that after first if block it jumps to return line even when the file contains more than 5 000 lines.
I had the same problem a few months ago, but it somehow got to work. Any ideas what can cause this problem?
 
    