If an input buffer and an output buffer for the curve filter are same, it reads
and writes to the same texture which behavior is not defined. I could not find
good reference for this, but following could be a reference.
The texture gets 0 color value as a result. So the curve filter does not work.
This patch makes the curve filter use different input and output buffer.