- u_out = frame->data[1] + (height - 1) * frame->linesize[1];
- v_out = frame->data[2] + (height - 1) * frame->linesize[2];
+ offset = (height - 1) * frame->linesize[1];
+ u_out = FF_PTR_ADD(frame->data[1], offset);
+ offset = (height - 1) * frame->linesize[2];
+ v_out = FF_PTR_ADD(frame->data[2], offset);