No problem, Good luck! 
-Just a little reminder:
This version doesn't have the issue, and it probably using some openmp for some loops:
It's probably some of the recent loops cause the issue, how many loops? I don't know. It could be that one loop with openmp casues the problem.
Actually that version was the same last version that you tried, I went to my older posts and replaced it

It did have the issue as well, but as you mentioned, it was only showing up sometimes.
There are a few loops that I was not sure about, and one of them was the culprit. Your test sample looks good now, I played back and forth multiple times with no issue, so I've updated the Git branch (
here a compiled version for Windows just in case)
I read that whenever you have an expression over a shared variable like "var++;", you need to use "atomic", and that makes sense, but in the case below I first thought it was not needed because the address on that 2-dimension vector will be different on each loop given that y and x are different, but it's not always... With the "atomic" directive should be fine

#pragma omp parallel for schedule(static) default(none) shared(raw_info, image_data, y0, h, w,hist) collapse(2)
for (int y = y0; y < h/4*4; y++)
{
for (int x = 0; x < w; x++){
#pragma omp atomic
hist[(y%2)*2 + (x%2)][raw_get_pixel16(x,y) & 16383]++;
}
}