etrunko pushed a commit to branch master.

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

commit 48d9936f9c13f6c686f5e55a497e395a67cd461c
Author: Eduardo Lima (Etrunko) <ebl...@gmail.com>
Date:   Fri Mar 11 10:03:09 2016 -0300

    albumart: avoid crash if substring is not found
    
    Test case: https://soundcloud.com/audiotonic/audio_tonic_mr_mr_radio_1_2702
    
    Signed-off-by: Eduardo Lima (Etrunko) <ebl...@gmail.com>
---
 src/bin/albumart.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/bin/albumart.c b/src/bin/albumart.c
index 78a9cc9..8aeec5b 100644
--- a/src/bin/albumart.c
+++ b/src/bin/albumart.c
@@ -133,12 +133,15 @@ _cb_http_complete(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event)
                   if (p)
                     {
                        p = strstr(p, "src=\"http");
-                       p += 5;
-                       pe = strchr(p, '"');
-                       if (pe)
+                       if (p)
                          {
-                            eina_strbuf_append_length(sb, p, pe - p);
-                            ok = EINA_TRUE;
+                            p += 5;
+                            pe = strchr(p, '"');
+                            if (pe)
+                              {
+                                 eina_strbuf_append_length(sb, p, pe - p);
+                                 ok = EINA_TRUE;
+                              }
                          }
                     }
                   if (!ok)

-- 


Reply via email to