From 1e3084aa95463547cada647ec4a7d0725b4c43b0 Mon Sep 17 00:00:00 2001 From: Vineeth T M Date: Fri, 29 May 2015 15:40:04 +0100 Subject: [PATCH] validate-utils: sqrt(-1.0) leads to undefined result Using sqrt of -1 is not valid and leads to undefined results. When comparing the return value of the fucntion in validate-scenario, it is being checked with ret == -1, so it makes sense to just return -1 in error case. https://bugzilla.gnome.org/show_bug.cgi?id=748389 --- validate/gst/validate/gst-validate-utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/validate/gst/validate/gst-validate-utils.c b/validate/gst/validate/gst-validate-utils.c index a157a0298d..506a5cd1bf 100644 --- a/validate/gst/validate/gst-validate-utils.c +++ b/validate/gst/validate/gst-validate-utils.c @@ -322,10 +322,9 @@ _parse (MathParser * parser) "Failed to reach end of input expression, likely malformed input"); } else return result; - } else { - return sqrt (-1.0); } - return sqrt (-1.0); + + return -1.0; } static gdouble