From 2d4de9dd75dd91fd9ff1e21b5f1c903abd0ba3d6 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 11 Jan 2014 23:34:03 +0100 Subject: [PATCH] Add misc.h include to artwork and correct safe_atoi32 call --- src/artwork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/artwork.c b/src/artwork.c index 9a08263f..2221854f 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -36,6 +36,7 @@ #include #include "db.h" +#include "misc.h" #include "logger.h" #include "conffile.h" @@ -1079,8 +1080,7 @@ artwork_get_group(int id, int max_w, int max_h, int format, struct evbuffer *evb while (!got_art && ((ret = db_query_fetch_file(&qp, &dbmfi)) == 0) && (dbmfi.id)) { #if LIBAVFORMAT_VERSION_MAJOR >= 55 || (LIBAVFORMAT_VERSION_MAJOR == 54 && LIBAVFORMAT_VERSION_MINOR >= 20) - safeatoi32(&dbmfi->artwork, &artwork_t); - if (artwork_t == ARTWORK_EMBEDDED) + if ((safe_atoi32(dbmfi.artwork, &artwork_t) == 0) && (artwork_t == ARTWORK_EMBEDDED)) got_art = (artwork_get_embedded_image(dbmfi.path, max_w, max_h, format, evbuf) > 0); else got_art = (artwork_get_own_image(dbmfi.path, max_w, max_h, format, evbuf) > 0);