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>
This commit is contained in:
parent
4b0016f045
commit
19532eec2a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user