summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-05-19 19:06:45 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-05-19 19:06:45 +0200
commit1afc62ef88274fea322f6c53857890fe17c9fdcf (patch)
tree443b87b0c515b5ec31c006d5d1af3525c3fdbab0
parentb7d35a6235010df4cdc89961641b57ccb972f7fa (diff)
downloadqt3-1afc62ef88274fea322f6c53857890fe17c9fdcf.tar.gz
qt3-1afc62ef88274fea322f6c53857890fe17c9fdcf.zip
Fix overwriting memory for an application icon
This resolves Bug 2033
-rw-r--r--src/kernel/qimage.cpp12
-rw-r--r--src/kernel/qpixmap_x11.cpp4
-rw-r--r--src/kernel/qwidget_x11.cpp1
3 files changed, 9 insertions, 8 deletions
diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp
index 214fc85..4c489d2 100644
--- a/src/kernel/qimage.cpp
+++ b/src/kernel/qimage.cpp
@@ -1531,12 +1531,12 @@ static bool convert_32_to_8( const QImage *src, QImage *dst, int conversion_flag
int* line2[3];
int* pv[3];
if ( ( conversion_flags & Qt::Dither_Mask ) == Qt::DiffuseDither ) {
- line1[0] = new int[src->width()];
- line2[0] = new int[src->width()];
- line1[1] = new int[src->width()];
- line2[1] = new int[src->width()];
- line1[2] = new int[src->width()];
- line2[2] = new int[src->width()];
+ line1[0] = new int[sw];
+ line2[0] = new int[sw];
+ line1[1] = new int[sw];
+ line2[1] = new int[sw];
+ line1[2] = new int[sw];
+ line2[2] = new int[sw];
pv[0] = new int[sw];
pv[1] = new int[sw];
pv[2] = new int[sw];
diff --git a/src/kernel/qpixmap_x11.cpp b/src/kernel/qpixmap_x11.cpp
index d0a16c5..28d2926 100644
--- a/src/kernel/qpixmap_x11.cpp
+++ b/src/kernel/qpixmap_x11.cpp
@@ -764,6 +764,7 @@ QImage QPixmap::convertToImage() const
else
#endif
qSafeXDestroyImage( xi );
+ ((QPixmap*)this)->data->ximage = 0;
return image;
}
@@ -947,7 +948,8 @@ QImage QPixmap::convertToImage() const
qt_XShmDestroyImage( xi, &shminfo );
else
#endif
- qSafeXDestroyImage( xi );
+ qSafeXDestroyImage( xi );
+ ((QPixmap*)this)->data->ximage = 0;
return image;
}
diff --git a/src/kernel/qwidget_x11.cpp b/src/kernel/qwidget_x11.cpp
index f98a5cb..ddad9cd 100644
--- a/src/kernel/qwidget_x11.cpp
+++ b/src/kernel/qwidget_x11.cpp
@@ -1336,7 +1336,6 @@ void QWidget::setIcon( const QPixmap &pixmap )
int r = int( qRed( l ) );
int g = int( qGreen( l ) );
int b = int( qBlue( l ) );
- ls[x] = qRgb( r, g, b );
XSetForeground(x11Display(), gc, (r << 16) | (g << 8) | b );
XDrawPoint(x11Display(), pmHandle, gc, x, y);
}