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) <eblima@gmail.com>
v-0.4.0
Eduardo Lima (Etrunko) 7 years ago
parent fae6f88df7
commit 48d9936f9c
  1. 13
      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)

Loading…
Cancel
Save