diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 65f292a55..96a17adb3 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -2332,15 +2332,15 @@ int freerdp_image24_copy(BYTE* pDstData, DWORD DstFormat, int nDstStep, int nXDs dstFlip = FREERDP_PIXEL_FORMAT_FLIP(DstFormat); dstType = FREERDP_PIXEL_FORMAT_TYPE(DstFormat); - nSrcPad = (nSrcStep - (nWidth * srcBytesPerPixel)); - nDstPad = (nDstStep - (nWidth * dstBytesPerPixel)); - if (nSrcStep < 0) nSrcStep = srcBytesPerPixel * nWidth; if (nDstStep < 0) nDstStep = dstBytesPerPixel * nWidth; + nSrcPad = (nSrcStep - (nWidth * srcBytesPerPixel)); + nDstPad = (nDstStep - (nWidth * dstBytesPerPixel)); + if (srcFlip != dstFlip) vFlip = TRUE;