decoder/ffmpeg: fix double free bug

From the avformat_open_input() API documentation:

 "Note that a user-supplied AVFormatContext will be freed on failure."

https://bugs.musicpd.org/view.php?id=4607
This commit is contained in:
Max Kellermann 2016-12-13 08:34:05 +01:00
parent f61a5f5200
commit 7146f825b2
2 changed files with 2 additions and 1 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.20 (not yet released) ver 0.19.20 (not yet released)
* decoder
- ffmpeg: fix crash bug
ver 0.19.20 (2016/12/09) ver 0.19.20 (2016/12/09)
* protocol * protocol

View File

@ -71,7 +71,6 @@ FfmpegOpenInput(AVIOContext *pb,
int err = avformat_open_input(&context, filename, fmt, nullptr); int err = avformat_open_input(&context, filename, fmt, nullptr);
if (err < 0) { if (err < 0) {
avformat_free_context(context);
SetFfmpegError(error, err, "avformat_open_input() failed"); SetFfmpegError(error, err, "avformat_open_input() failed");
return nullptr; return nullptr;
} }