diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-03-10 14:44:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-15 10:44:56 +0100 |
commit | 19532eec2ae1a723e981e3f90730905cabedb9c8 (patch) | |
tree | d313baab593a794669c7057c7f6e7c7583966ef3 | |
parent | 4b0016f045a4f78b8cc9bb6e8ded40db0f8a30ec (diff) |
Fix casting and overallocation in qregion.cpp
The POINTBLOCK struct in qregion.cpp is badly defined. By using ints
as the base storage of the internal array it forces not only bad casting
from int to QPoint, but also allocates an array four times too big.
This patch changes to char, since a char pointer may alias anything and
this gives the right size of the array.
Change-Id: I608eaf39ac7306c71314a139bed6e2352249c0ab
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
-rw-r--r-- | src/gui/painting/qregion.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index beeac6bd43..20c62fdd9d 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -1713,7 +1713,7 @@ QT_END_INCLUDE_NAMESPACE * the buffers together */ typedef struct _POINTBLOCK { - int data[NUMPTSTOBUFFER * sizeof(QPoint)]; + char data[NUMPTSTOBUFFER * sizeof(QPoint)]; QPoint *pts; struct _POINTBLOCK *next; } POINTBLOCK; |