diff --git a/picojpeg.c b/picojpeg.c index 2fae2a9..a45bb95 100644 --- a/picojpeg.c +++ b/picojpeg.c @@ -1730,10 +1730,13 @@ static void convertCb(uint8 dstOfs) int16 cbG, cbB; cbG = ((cb * 88U) >> 8U) - 44U; - *pDstG++ = subAndClamp(pDstG[0], cbG); + pDstG[0] = subAndClamp(pDstG[0], cbG); cbB = (cb + ((cb * 198U) >> 8U)) - 227U; - *pDstB++ = addAndClamp(pDstB[0], cbB); + pDstB[0] = addAndClamp(pDstB[0], cbB); + + ++pDstG; + ++pDstB; } } /*----------------------------------------------------------------------------*/ @@ -1751,10 +1754,13 @@ static void convertCr(uint8 dstOfs) int16 crR, crG; crR = (cr + ((cr * 103U) >> 8U)) - 179; - *pDstR++ = addAndClamp(pDstR[0], crR); + pDstR[0] = addAndClamp(pDstR[0], crR); crG = ((cr * 183U) >> 8U) - 91; - *pDstG++ = subAndClamp(pDstG[0], crG); + pDstG[0] = subAndClamp(pDstG[0], crG); + + ++pDstR; + ++pDstG; } } /*----------------------------------------------------------------------------*/