From da6edd7fe77f128711fd968b19c6a2f5ea5e0ede Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Thu, 29 Jun 2017 18:56:59 +0200 Subject: [PATCH] access: bluray: correct asprintf usage --- modules/access/bluray.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/access/bluray.c b/modules/access/bluray.c index 7e4603a3ac..bdd3ffac80 100644 --- a/modules/access/bluray.c +++ b/modules/access/bluray.c @@ -1921,17 +1921,15 @@ static int blurayControl(demux_t *p_demux, int query, va_list args) else if (meta->thumb_count > 0 && meta->thumbnails && p_sys->psz_bd_path) { char *psz_thumbpath; if (asprintf(&psz_thumbpath, "%s" DIR_SEP "BDMV" DIR_SEP "META" DIR_SEP "DL" DIR_SEP "%s", - p_sys->psz_bd_path, meta->thumbnails[0].path) > 0) { + p_sys->psz_bd_path, meta->thumbnails[0].path) > -1) { char *psz_thumburl = vlc_path2uri(psz_thumbpath, "file"); - if (unlikely(psz_thumburl == NULL)) { - free(psz_thumbpath); + free(psz_thumbpath); + if (unlikely(psz_thumburl == NULL)) return VLC_ENOMEM; - } vlc_meta_SetArtURL(p_meta, psz_thumburl); free(psz_thumburl); } - free(psz_thumbpath); } return VLC_SUCCESS; -- 2.11.4.GIT