Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 838f641

Browse files
committed
bugfix segfault in transforms module. Thanks Ben North for the patch
svn path=/trunk/matplotlib/; revision=3547
1 parent bb02f58 commit 838f641

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2007-07-17 bugfix segfault in transforms module. Thanks Ben North for
2+
the patch. - ADS
3+
14
2007-07-16 clean up some code in ticker.ScalarFormatter, use unicode to
25
render multiplication sign in offset ticklabel - DSD
36

src/_transforms.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Value::get(const Py::Tuple & args) {
3333
int
3434
LazyValue::compare(const Py::Object &other) {
3535
if (!check(other))
36-
throw Py::TypeError("Can on compare LazyValues with LazyValues");
36+
throw Py::TypeError("Can only compare LazyValues with LazyValues");
3737
LazyValue* pother = static_cast<LazyValue*>(other.ptr());
3838
double valself = val();
3939
double valother = pother->val();
@@ -2079,12 +2079,13 @@ _transforms_module::new_affine (const Py::Tuple &args) {
20792079

20802080
args.verify_length(6);
20812081

2082-
LazyValue::check(args[0]);
2083-
LazyValue::check(args[1]);
2084-
LazyValue::check(args[2]);
2085-
LazyValue::check(args[3]);
2086-
LazyValue::check(args[4]);
2087-
LazyValue::check(args[5]);
2082+
if (!LazyValue::check(args[0])
2083+
|| !LazyValue::check(args[1])
2084+
|| !LazyValue::check(args[2])
2085+
|| !LazyValue::check(args[3])
2086+
|| !LazyValue::check(args[4])
2087+
|| !LazyValue::check(args[5]))
2088+
throw Py::TypeError("Affine(a, b, c, d, tx, ty) expected 6 LazyValue args");
20882089

20892090
LazyValue* a = static_cast<LazyValue*>(args[0].ptr());
20902091
LazyValue* b = static_cast<LazyValue*>(args[1].ptr());

0 commit comments

Comments
 (0)