Protect against possible segfault if the artwork pixel format is unknown

- thank you groinwood for reporting this bug
This commit is contained in:
ejurgensen 2015-08-24 21:27:55 +02:00
parent 317ad2ba41
commit 294d7a270f

View File

@ -204,6 +204,14 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out
return -1;
}
if (src->pix_fmt < 0)
{
DPRINTF(E_LOG, L_ART, "Unknown pixel format for artwork %s\n", src_ctx->filename);
ret = -1;
goto out_close_src;
}
/* Set up output */
dst_fmt = av_guess_format("image2", NULL, NULL);
if (!dst_fmt)