blob: 1a465562e0a982894b8e258d420de3eda72b92ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-ja,v 1.2 2006/10/23 14:54:11 adam Exp $
--- src/kernel/qpixmap_x11.cpp.orig 2006-10-19 16:25:12.000000000 +0200
+++ src/kernel/qpixmap_x11.cpp
@@ -1766,6 +1766,12 @@ QPixmap QPixmap::xForm( const QWMatrix &
dbpl = ((w*bpp+31)/32)*4;
dbytes = dbpl*h;
+ if (dbytes != (long long) dbpl*h) { // Integer overflow detection
+ QPixmap pm;
+ pm.data->bitmap = data->bitmap;
+ return pm;
+ }
+
#if defined(QT_MITSHM)
if ( use_mitshm ) {
dptr = (uchar *)xshmimg->data;
@@ -1875,6 +1881,11 @@ QPixmap QPixmap::xForm( const QWMatrix &
sptr = (uchar *) axi->data;
bpp = axi->bits_per_pixel;
dbytes = dbpl * h;
+ if (dbytes != (long long) dbpl*h) { // Integer overflow detection
+ QPixmap pm;
+ pm.data->bitmap = data->bitmap;
+ return pm;
+ }
dptr = (uchar *) malloc(dbytes);
Q_CHECK_PTR( dptr );
memset(dptr, 0, dbytes);
|