From b0fc5107c9f78e3414a748beb12b67dadaeed381 Mon Sep 17 00:00:00 2001 From: tTh Date: Tue, 4 Jul 2023 17:25:12 +0200 Subject: [PATCH] add a molly guard --- lib/interpolate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/interpolate.c b/lib/interpolate.c index a453a05..a9c009b 100644 --- a/lib/interpolate.c +++ b/lib/interpolate.c @@ -49,6 +49,14 @@ fprintf(stderr, ">>> %s ( %p %p %p %f )\n", __func__, s1, s2, d, coef); #endif +/* sanity check here ? or may be ask the + caller to do it himself ? +*/ +if ( (coef < 0.0) || (coef >= 1.0) ){ + fprintf(stderr, "%s: coef %f out of range\n", __func__, coef); + return -8; + } + foo = fimg_images_not_compatible(s1, s2); if (foo) { fprintf(stderr, "compat s1 s2 -> %d\n", foo);