One cannot tell much from the snippet you posted. Consider posting a minimal, complete, self-contained repro code others can build and run. If I had to guess, you may not pass in texture coordinates correctly, or you may have incorrectly set up the texture attributes.
Note that the middle of each texel has an offset of 0.5 in both dimensions (e.g. the texel at 0,0 has its center at 0.5, 0.5). I am mentioning this because it’s a frequent mistake.