Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.0
-
None
-
ac8a3b948da1980bc59bae3fc76d20b5b45662a0
Description
Accidental detach in qt_bitmapToRegion
While looking for accidental detaches in our application, I found one was occurring frequently inside the following QT code:
QRegionPrivate *qt_bitmapToRegion(const QBitmap& bitmap) { QImage image = bitmap.toImage(); ... for (y = 0; y < image.height(); ++y) { uchar *line = image.scanLine(y); // <<<<<<<<<<< detach here - uses non-const scanLine() when it doesn't need to. int w = image.width(); uchar all = zero; int prev1 = -1; for (x = 0; x < w;) { uchar byte = line[x / 8];
Changing the offending line to the following should be a simple low risk fix:
const uchar *line = image.scanLine(y);