File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ void BufferRegion::to_string_argb(uint8_t *buf)
11
11
unsigned char tmp;
12
12
size_t i, j;
13
13
14
- memcpy (buf, data, height * stride);
14
+ memcpy (buf, data, ( size_t ) height * stride);
15
15
16
16
for (i = 0 ; i < (size_t )height; ++i) {
17
17
pix = buf + i * stride;
Original file line number Diff line number Diff line change @@ -1124,7 +1124,7 @@ class QuadMeshGenerator
1124
1124
1125
1125
inline size_t num_paths () const
1126
1126
{
1127
- return m_meshWidth * m_meshHeight;
1127
+ return ( size_t ) m_meshWidth * m_meshHeight;
1128
1128
}
1129
1129
1130
1130
inline path_iterator operator ()(size_t i) const
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ static PyObject *PyBufferRegion_to_string(PyBufferRegion *self, PyObject *args)
53
53
return NULL ;
54
54
}
55
55
return PyBytes_FromStringAndSize ((const char *)self->x ->get_data (),
56
- self->x ->get_height () * self->x ->get_stride ());
56
+ (Py_ssize_t) self->x ->get_height () * self->x ->get_stride ());
57
57
}
58
58
59
59
/* TODO: This doesn't seem to be used internally. Remove? */
@@ -98,8 +98,10 @@ static PyObject *PyBufferRegion_to_string_argb(PyBufferRegion *self, PyObject *a
98
98
}
99
99
PyObject *bufobj;
100
100
uint8_t *buf;
101
-
102
- bufobj = PyBytes_FromStringAndSize (NULL , self->x ->get_height () * self->x ->get_stride ());
101
+ Py_ssize_t height, stride;
102
+ height = self->x ->get_height ();
103
+ stride = self->x ->get_stride ();
104
+ bufobj = PyBytes_FromStringAndSize (NULL , height * stride);
103
105
buf = (uint8_t *)PyBytes_AS_STRING (bufobj);
104
106
105
107
CALL_CPP_CLEANUP (" to_string_argb" , (self->x ->to_string_argb (buf)), Py_DECREF (bufobj));
Original file line number Diff line number Diff line change @@ -1222,7 +1222,7 @@ bool convert_to_string(PathIterator &path,
1222
1222
clipped_t clipped (nan_removed, do_clip, clip_rect);
1223
1223
simplify_t simplified (clipped, simplify, path.simplify_threshold ());
1224
1224
1225
- buffersize = path.total_vertices () * (precision + 5 ) * 4 ;
1225
+ buffersize = ( size_t ) path.total_vertices () * (precision + 5 ) * 4 ;
1226
1226
if (buffersize == 0 ) {
1227
1227
return true ;
1228
1228
}
You can’t perform that action at this time.
0 commit comments