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 e1f934c

Browse filesBrowse files
committed
Backport TkAgg segfault fix.
svn path=/branches/v0_91_maint/; revision=5211
1 parent bf0fc71 commit e1f934c
Copy full SHA for e1f934c

File tree

Expand file treeCollapse file tree

2 files changed

+13
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-2
lines changed

‎CHANGELOG

Copy file name to clipboardExpand all lines: CHANGELOG
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2008-05-21 Fix segfault in TkAgg backend - MGD
2+
13
2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM
24

35
2008-05-19 Fix crash when Windows can not access the registry to

‎src/_tkagg.cpp

Copy file name to clipboardExpand all lines: src/_tkagg.cpp
+11-2Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
5050
agg::int8u *destbuffer;
5151
double l,b,r,t;
5252
int destx, desty, destwidth, destheight, deststride;
53+
unsigned long aggl, bboxl;
5354

5455
long mode;
5556
long nval;
@@ -71,7 +72,11 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
7172
return TCL_ERROR;
7273
}
7374
/* get array (or object that can be converted to array) pointer */
74-
aggo = (PyObject*)atol(argv[2]);
75+
if (sscanf (argv[2],"%lu",&aggl) != 1) {
76+
Tcl_AppendResult(interp, "error casting pointer", (char *) NULL);
77+
return TCL_ERROR;
78+
}
79+
aggo = (PyObject*)aggl;
7580
RendererAgg *aggRenderer = (RendererAgg *)aggo;
7681
int srcheight = (int)aggRenderer->get_height();
7782

@@ -85,7 +90,11 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
8590
}
8691

8792
/* check for bbox/blitting */
88-
bboxo = (PyObject*)atol(argv[4]);
93+
if (sscanf(argv[4], "%lu", &bboxl) != 1) {
94+
Tcl_AppendResult(interp, "error casting pointer", (char *) NULL);
95+
return TCL_ERROR;
96+
}
97+
bboxo = (PyObject*)bboxl;
8998
if (bboxo != Py_None) {
9099
bbox = (Bbox*)bboxo;
91100
l = bbox->ll_api()->x_api()->val();

0 commit comments

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