[filescanner] Fix Use-after-free error

library/filescanner_ffmpeg.c:396:7: warning: Use of memory after it is
freed
This commit is contained in:
chme 2018-12-17 08:30:57 +01:00 committed by ejurgensen
parent 80a86cbab5
commit 21ce281cd1

View File

@ -388,17 +388,18 @@ scan_metadata_ffmpeg(const char *file, struct media_file_info *mfi)
return -1;
}
free(path);
ret = avformat_find_stream_info(ctx, NULL);
if (ret < 0)
{
DPRINTF(E_WARN, L_SCAN, "Cannot get stream info of '%s': %s\n", path, err2str(ret));
avformat_close_input(&ctx);
free(path);
return -1;
}
free(path);
#if 0
/* Dump input format as determined by ffmpeg */
av_dump_format(ctx, 0, file, 0);