raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=b24a22ba6f9861ae296d7b528110bc35c2bade08

commit b24a22ba6f9861ae296d7b528110bc35c2bade08
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue Aug 6 10:25:17 2019 +0100

    video - handle null file sets nicely
    
    makes coverity happy
---
 src/bin/video.c | 62 ++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 35 insertions(+), 27 deletions(-)

diff --git a/src/bin/video.c b/src/bin/video.c
index eb4a056..35d5a63 100644
--- a/src/bin/video.c
+++ b/src/bin/video.c
@@ -634,41 +634,49 @@ video_file_set(Evas_Object *obj, const char *file)
    evas_object_hide(sd->o_vid);
    evas_object_hide(sd->clip);
    eina_stringshare_replace(&(sd->file), file);
-   if (!strncasecmp(sd->file, "file:/", 6))
+   if (sd->file)
      {
-        Efreet_Uri *uri = efreet_uri_decode(sd->file);
-        if (uri)
+        if (!strncasecmp(sd->file, "file:/", 6))
           {
-             realfile = ecore_file_realpath(uri->path);
-             efreet_uri_free(uri);
+             Efreet_Uri *uri = efreet_uri_decode(sd->file);
+             if (uri)
+               {
+                  realfile = ecore_file_realpath(uri->path);
+                  efreet_uri_free(uri);
+               }
           }
-     }
-   else if ((!strncasecmp(sd->file, "http:/", 6)) ||
-            (!strncasecmp(sd->file, "https:/", 7)))
-     realfile = strdup(sd->file);
-   else
-     realfile = ecore_file_realpath(sd->file);
-   eina_stringshare_replace(&(sd->realfile), realfile);
-   free(realfile);
-   eina_stringshare_replace(&(sd->artfile), NULL);
-   emotion_object_file_set(sd->o_vid, sd->file);
-   video_position_set(obj, 0.0);
-   if ((sd->file) && (sd->doart))
-     {
-        const char *extn = strchr(sd->file, '.');
-        if (extn)
+        else if ((!strncasecmp(sd->file, "http:/", 6)) ||
+                 (!strncasecmp(sd->file, "https:/", 7)))
+          realfile = strdup(sd->file);
+        else
+          realfile = ecore_file_realpath(sd->file);
+        eina_stringshare_replace(&(sd->realfile), realfile);
+        free(realfile);
+        eina_stringshare_replace(&(sd->artfile), NULL);
+        emotion_object_file_set(sd->o_vid, sd->file);
+        video_position_set(obj, 0.0);
+        if (sd->doart)
           {
-             if ((!strcasecmp(extn, ".mp3")) ||
-                 (!strcasecmp(extn, ".m4a")) ||
-                 (!strcasecmp(extn, ".oga")) ||
-                 (!strcasecmp(extn, ".aac")) ||
-                 (!strcasecmp(extn, ".flac")) ||
-                 (!strcasecmp(extn, ".wav")))
+             const char *extn = strchr(sd->file, '.');
+             if (extn)
                {
-                  _art_check(obj);
+                  if ((!strcasecmp(extn, ".mp3")) ||
+                      (!strcasecmp(extn, ".m4a")) ||
+                      (!strcasecmp(extn, ".oga")) ||
+                      (!strcasecmp(extn, ".aac")) ||
+                      (!strcasecmp(extn, ".flac")) ||
+                      (!strcasecmp(extn, ".wav")))
+                    {
+                       _art_check(obj);
+                    }
                }
           }
      }
+   else
+     {
+        eina_stringshare_replace(&(sd->realfile), NULL);
+        eina_stringshare_replace(&(sd->artfile), NULL);
+     }
 }
 
 const char *

-- 


Reply via email to