raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=29fce429004f9f14d79c5bfa97b1010c2113fa15

commit 29fce429004f9f14d79c5bfa97b1010c2113fa15
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Jul 29 07:57:17 2016 +0900

    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 d9e6fa7..9156227 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 3e0c02b..8e38333 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();
      }

-- 


Reply via email to