System is giving me out of range exception when p = 255. My understading is that with "OR operator, later part of if statement shoudl come into affet. However, it is not. Please advise on how to fix it.
for (int p = 0; p < 256; p++) { if (buffer[p] == buffer[p + 1] || buffer[p] == buffer[p - 1]) { //Code } }