diff options
Diffstat (limited to 'src/plugins/imageformats/jpeg/qjpeghandler.cpp')
-rw-r--r-- | src/plugins/imageformats/jpeg/qjpeghandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index d51668a..e5e5e80 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -342,6 +342,7 @@ QImage QImageSmoothScaler::scale() register int needcol; nxP = (QRgb *)dst.scanLine(rowswritten++); + QRgb *nxPEnd = nxP + d->newcols; fraccoltofill = SCALE; a = r = g = b = HALFSCALE; needcol = 0; @@ -425,7 +426,7 @@ QImage QImageSmoothScaler::scale() b += fraccoltofill * qBlue(*xP); } } - if (!needcol) { + if (nxP < nxPEnd) { r /= SCALE; if (r > maxval) r = maxval; @@ -443,6 +444,8 @@ QImage QImageSmoothScaler::scale() } else { *nxP = qRgb((int)r, (int)g, (int)b); } + while (++nxP != nxPEnd) + nxP[0] = nxP[-1]; } } } |