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>
This commit is contained in:
Eduardo Lima (Etrunko) 2016-03-11 10:03:09 -03:00
parent fae6f88df7
commit 48d9936f9c
1 changed files with 8 additions and 5 deletions

View File

@ -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)