wcap: Check for mmap and malloc return value in wcap decode module
Checking for return value in main.c for wcap_decoder_create function
and mmap, malloc return value in wcap_decoder_create function to avoid
crashes
Signed-off-by: vivek <vivek.ellur@samsung.com>
diff --git a/wcap/main.c b/wcap/main.c
index 29bb9c3..16d37f0 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -251,6 +251,10 @@
}
decoder = wcap_decoder_create(argv[1]);
+ if (decoder == NULL) {
+ fprintf(stderr, "Creating wcap decoder failed\n");
+ exit(EXIT_FAILURE);
+ }
if (yuv4mpeg2 && isatty(1)) {
fprintf(stderr, "Not dumping yuv4mpeg2 data to terminal. Pipe output to a file or a process.\n");