Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 68ef27d

Browse filesBrowse files
authored
Merge pull request #19210 from pkgw/fix-gigapixel-agg
FIX: creation of AGG images bigger than 1024**3 pixels
2 parents 796dbf4 + 0e05d70 commit 68ef27d
Copy full SHA for 68ef27d

File tree

Expand file treeCollapse file tree

3 files changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-3
lines changed

‎extern/agg24-svn/include/agg_rasterizer_cells_aa.h

Copy file name to clipboardExpand all lines: extern/agg24-svn/include/agg_rasterizer_cells_aa.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ namespace agg
329329
int cy = (y1 + y2) >> 1;
330330
line(x1, y1, cx, cy);
331331
line(cx, cy, x2, y2);
332+
return;
332333
}
333334

334335
int dy = y2 - y1;

‎src/_backend_agg.cpp

Copy file name to clipboardExpand all lines: src/_backend_agg.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi)
2929
: width(width),
3030
height(height),
3131
dpi(dpi),
32-
NUMBYTES(width * height * 4),
32+
NUMBYTES((size_t)width * (size_t)height * 4),
3333
pixBuffer(NULL),
3434
renderingBuffer(),
3535
alphaBuffer(NULL),

‎src/_backend_agg_wrapper.cpp

Copy file name to clipboardExpand all lines: src/_backend_agg_wrapper.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int PyBufferRegion_get_buffer(PyBufferRegion *self, Py_buffer *buf, int flags)
9595
Py_INCREF(self);
9696
buf->obj = (PyObject *)self;
9797
buf->buf = self->x->get_data();
98-
buf->len = self->x->get_width() * self->x->get_height() * 4;
98+
buf->len = (Py_ssize_t)self->x->get_width() * (Py_ssize_t)self->x->get_height() * 4;
9999
buf->readonly = 0;
100100
buf->format = (char *)"B";
101101
buf->ndim = 3;
@@ -531,7 +531,7 @@ int PyRendererAgg_get_buffer(PyRendererAgg *self, Py_buffer *buf, int flags)
531531
Py_INCREF(self);
532532
buf->obj = (PyObject *)self;
533533
buf->buf = self->x->pixBuffer;
534-
buf->len = self->x->get_width() * self->x->get_height() * 4;
534+
buf->len = (Py_ssize_t)self->x->get_width() * (Py_ssize_t)self->x->get_height() * 4;
535535
buf->readonly = 0;
536536
buf->format = (char *)"B";
537537
buf->ndim = 3;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.