From 29fce429004f9f14d79c5bfa97b1010c2113fa15 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 29 Jul 2016 07:57:17 +0900 Subject: [PATCH] evas generic gst loader - handle fwrite return value for coverity fixes CID 1360467 --- src/generic/evas/gst/main.c | 8 ++++++-- src/generic/evas/gst/main_0_10.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/generic/evas/gst/main.c b/src/generic/evas/gst/main.c index d9e6fa786c..915622705d 100644 --- a/src/generic/evas/gst/main.c +++ b/src/generic/evas/gst/main.c @@ -272,14 +272,18 @@ main(int argc, char **argv) { if (shm_fd >= 0) { - printf("shmfile %s\n", shmfile); + printf("shmfile %s\n", shmfile); } else { // could also to "tmpfile %s\n" like shmfile but just // a mmaped tmp file on the system printf("data\n"); - fwrite(data, width * height * sizeof(DATA32), 1, stdout); + if (fwrite(data, width * height * sizeof(DATA32), 1, stdout) != 1) + { + shm_free(); + return -1; + } } shm_free(); } diff --git a/src/generic/evas/gst/main_0_10.c b/src/generic/evas/gst/main_0_10.c index 3e0c02b823..8e383334f6 100644 --- a/src/generic/evas/gst/main_0_10.c +++ b/src/generic/evas/gst/main_0_10.c @@ -258,14 +258,18 @@ main(int argc, char **argv) { if (shm_fd >= 0) { - printf("shmfile %s\n", shmfile); + printf("shmfile %s\n", shmfile); } else { // could also to "tmpfile %s\n" like shmfile but just // a mmaped tmp file on the system printf("data\n"); - fwrite(data, width * height * sizeof(DATA32), 1, stdout); + if (fwrite(data, width * height * sizeof(DATA32), 1, stdout) != 1) + { + shm_free(); + return -1; + } } shm_free(); }