I should point out that ordinarily buffer accesses that are out-of-range have undefined behavior in OpenGL. However, with the recent push in OpenGL 4.x for improved robustness, there is an extension that will allow you to define the behavior in these cases.
GL_ARB_robust_buffer_access_behavior
This extension works by passing a new flag to your OpenGL context when you create it, and then buffer accesses that are out of range will result in well-defined values.
In your case, a texelFetch (...)
that is out of range will return vec4 (0.0, 0.0, 0.0, 0.0)