The lower bound for chroma components is size.y + 1/2, not size.y - 1/2.
Attach a file by drag & drop or click to upload