From 294d7a270f05df6f65df1c1d4d5a8bcbb64a76e7 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 24 Aug 2015 21:27:55 +0200 Subject: [PATCH] Protect against possible segfault if the artwork pixel format is unknown - thank you groinwood for reporting this bug --- src/artwork.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/artwork.c b/src/artwork.c index c454eebd..27223c75 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -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)