Sigurd Pettersen pointed out that the legend texture has to be a power of two high, that is four, and not tree.
Some simpler OGL drivers will scale the texture to power of two behind the scenes, and the texture will not be clean anymore resulting in addressing it "between colors".
p4#: 22323