diff options
-rw-r--r-- | mpd-notification.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mpd-notification.c b/mpd-notification.c index 0bfa252..bf4ebc9 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -61,7 +61,7 @@ void received_signal(int signal) { GdkPixbuf * retrieve_album_art(const char * music_dir, const char * uri) { int i; AVPacket pkt; - AVFormatContext * pFormatCtx = NULL; + AVFormatContext * pFormatCtx; GdkPixbufLoader * loader; GdkPixbuf * pixbuf = NULL; char * uri_path = NULL; @@ -101,12 +101,12 @@ GdkPixbuf * retrieve_album_art(const char * music_dir, const char * uri) { } fail: + avformat_close_input(&pFormatCtx); + avformat_free_context(pFormatCtx); + if (uri_path) free(uri_path); - if (pFormatCtx) - avformat_free_context(pFormatCtx); - return pixbuf; } #endif |