Fix overwriting memory for an application icon

This resolves Bug 2033
pull/2/head
Slávek Banko 11 years ago
parent b7d35a6235
commit 1afc62ef88

@ -1531,12 +1531,12 @@ static bool convert_32_to_8( const QImage *src, QImage *dst, int conversion_flag
int* line2[3]; int* line2[3];
int* pv[3]; int* pv[3];
if ( ( conversion_flags & Qt::Dither_Mask ) == Qt::DiffuseDither ) { if ( ( conversion_flags & Qt::Dither_Mask ) == Qt::DiffuseDither ) {
line1[0] = new int[src->width()]; line1[0] = new int[sw];
line2[0] = new int[src->width()]; line2[0] = new int[sw];
line1[1] = new int[src->width()]; line1[1] = new int[sw];
line2[1] = new int[src->width()]; line2[1] = new int[sw];
line1[2] = new int[src->width()]; line1[2] = new int[sw];
line2[2] = new int[src->width()]; line2[2] = new int[sw];
pv[0] = new int[sw]; pv[0] = new int[sw];
pv[1] = new int[sw]; pv[1] = new int[sw];
pv[2] = new int[sw]; pv[2] = new int[sw];

@ -764,6 +764,7 @@ QImage QPixmap::convertToImage() const
else else
#endif #endif
qSafeXDestroyImage( xi ); qSafeXDestroyImage( xi );
((QPixmap*)this)->data->ximage = 0;
return image; return image;
} }
@ -948,6 +949,7 @@ QImage QPixmap::convertToImage() const
else else
#endif #endif
qSafeXDestroyImage( xi ); qSafeXDestroyImage( xi );
((QPixmap*)this)->data->ximage = 0;
return image; return image;
} }

@ -1336,7 +1336,6 @@ void QWidget::setIcon( const QPixmap &pixmap )
int r = int( qRed( l ) ); int r = int( qRed( l ) );
int g = int( qGreen( l ) ); int g = int( qGreen( l ) );
int b = int( qBlue( l ) ); int b = int( qBlue( l ) );
ls[x] = qRgb( r, g, b );
XSetForeground(x11Display(), gc, (r << 16) | (g << 8) | b ); XSetForeground(x11Display(), gc, (r << 16) | (g << 8) | b );
XDrawPoint(x11Display(), pmHandle, gc, x, y); XDrawPoint(x11Display(), pmHandle, gc, x, y);
} }

Loading…
Cancel
Save