diff --git a/examples/cwebp.c b/examples/cwebp.c index d47f0be0..716a1117 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -698,7 +698,7 @@ int main(int argc, const char* argv[]) { if (argc == 1) { HelpShort(); - FREE_WARGV_AND_RETURN(EXIT_SUCCESS); + FREE_WARGV_AND_RETURN(EXIT_FAILURE); } for (c = 1; c < argc; ++c) { diff --git a/examples/gif2webp.c b/examples/gif2webp.c index 532cfcf6..2b297428 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -158,7 +158,7 @@ int main(int argc, const char* argv[]) { if (argc == 1) { Help(); - FREE_WARGV_AND_RETURN(EXIT_SUCCESS); + FREE_WARGV_AND_RETURN(EXIT_FAILURE); } for (c = 1; c < argc; ++c) { diff --git a/examples/img2webp.c b/examples/img2webp.c index ca1d0fd8..9cfccb43 100644 --- a/examples/img2webp.c +++ b/examples/img2webp.c @@ -229,6 +229,8 @@ int main(int argc, const char* argv[]) { } if (!have_input) { fprintf(stderr, "No input file(s) for generating animation!\n"); + ok = 0; + Help(); goto End; } diff --git a/examples/vwebp.c b/examples/vwebp.c index 7dbda4e2..89e8d8c1 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -568,7 +568,7 @@ int main(int argc, char* argv[]) { if (kParams.file_name == NULL) { printf("missing input file!!\n"); Help(); - FREE_WARGV_AND_RETURN(EXIT_SUCCESS); + FREE_WARGV_AND_RETURN(EXIT_FAILURE); } if (!ImgIoUtilReadFile(kParams.file_name, diff --git a/examples/webpinfo.c b/examples/webpinfo.c index 537e3f5a..ba8f1e12 100644 --- a/examples/webpinfo.c +++ b/examples/webpinfo.c @@ -1132,7 +1132,7 @@ int main(int argc, const char* argv[]) { if (argc == 1) { Help(); - FREE_WARGV_AND_RETURN(EXIT_SUCCESS); + FREE_WARGV_AND_RETURN(EXIT_FAILURE); } // Parse command-line input. diff --git a/extras/vwebp_sdl.c b/extras/vwebp_sdl.c index 04de98f0..1906bf39 100644 --- a/extras/vwebp_sdl.c +++ b/extras/vwebp_sdl.c @@ -57,6 +57,12 @@ int main(int argc, char* argv[]) { INIT_WARGV(argc, argv); + if (argc == 1) { + fprintf(stderr, "Usage: %s [-h] image.webp [more_files.webp...]\n", + argv[0]); + goto Error; + } + for (c = 1; c < argc; ++c) { const char* file = NULL; const uint8_t* webp = NULL;