From 1840a5bddda9715b89cf0287b19e96bc8150c9fa Mon Sep 17 00:00:00 2001 From: tth Date: Thu, 27 Feb 2020 11:25:30 +0100 Subject: [PATCH] added mollyguard --- funcs/filtrage.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/funcs/filtrage.c b/funcs/filtrage.c index 732c303..2d7100c 100644 --- a/funcs/filtrage.c +++ b/funcs/filtrage.c @@ -19,6 +19,11 @@ fprintf(stderr," type %d size %dx%d\n", img->type, img->width, img->height); #endif +if (img->type != FIMG_TYPE_RGB) { + fprintf(stderr, "%s : type %d invalide\n", __func__, img->type); + return -99; + } + pr = img->R; pg = img->G; pb = img->B; for (y=1; y < img->height-1; y++) { @@ -56,6 +61,12 @@ fprintf(stderr," type %d size %dx%d\n", img->type, img->width, img->height); #endif +if (img->type != FIMG_TYPE_RGB) { + fprintf(stderr, "%s : type %d invalide\n", __func__, img->type); + return -99; + } + + h = img->height; w = img->width; for (idx=0; idx