From 23a2e2bd00b53566c067e76c4fa220be756e4e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Wed, 20 Apr 2016 19:36:24 +0200 Subject: [PATCH] codegen: check for non-RGB images --- pysstv/examples/codeman.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pysstv/examples/codeman.c b/pysstv/examples/codeman.c index 082e449..a3460d5 100644 --- a/pysstv/examples/codeman.c +++ b/pysstv/examples/codeman.c @@ -7,6 +7,10 @@ int main(int argc, char **argv) { int x, y, n; unsigned char *img = stbi_load(argv[1], &x, &y, &n, 0); + if (n != 3) { + fprintf(stderr, "Only RGB images are supported\n"); + return 1; + } float freqs[FREQ_COUNT], msecs[FREQ_COUNT];