Bugfix: the Y coordinate of Point config fields was not correctly validated and lead to a crash when entering non-numeric values. Includes regression test. #1906

This commit is contained in:
Alessandro Ranellucci 2014-04-05 09:40:24 +02:00
parent f308a46cd5
commit b68c55fec0
2 changed files with 5 additions and 3 deletions

View file

@ -207,7 +207,7 @@ Pointf::from_SV(SV* point_sv)
AV* point_av = (AV*)SvRV(point_sv);
SV* sv_x = *av_fetch(point_av, 0, 0);
SV* sv_y = *av_fetch(point_av, 1, 0);
if (!looks_like_number(sv_x) || !looks_like_number(sv_x)) return false;
if (!looks_like_number(sv_x) || !looks_like_number(sv_y)) return false;
this->x = SvNV(sv_x);
this->y = SvNV(sv_y);