Don't crash on no metadata...

This commit is contained in:
ejurgensen 2015-03-29 20:16:56 +02:00
parent 2b2883403e
commit a529d78880

View File

@ -907,6 +907,8 @@ transcode_metadata(struct transcode_ctx *ctx, struct http_icy_metadata **metadat
return; return;
m = http_icy_metadata_get(ctx->fmtctx, 1); m = http_icy_metadata_get(ctx->fmtctx, 1);
if (!m)
return;
*changed = (m->hash != ctx->icy_hash); *changed = (m->hash != ctx->icy_hash);
@ -929,7 +931,11 @@ transcode_metadata_artwork_url(struct transcode_ctx *ctx, char **artwork_url, ch
return; return;
m = http_icy_metadata_get(ctx->fmtctx, 1); m = http_icy_metadata_get(ctx->fmtctx, 1);
if (!m)
return;
if (m->artwork_url) if (m->artwork_url)
*artwork_url = strdup(m->artwork_url); *artwork_url = strdup(m->artwork_url);
http_icy_metadata_free(m);
} }