aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgeneticdrift <geneticdrift@iotide.com>2014-02-07 12:54:03 +0200
committerMax Kellermann <max@duempel.org>2014-02-07 12:07:43 +0100
commitf225051348750cb9c2cf7ae632ad7950178e3675 (patch)
tree34e9eaf32c72439d00c9afc42eca0ea161733d78 /src
parentb2e3fdef0f142eb0be9f14dccd934b6e41fbde16 (diff)
downloadmpd-f225051348750cb9c2cf7ae632ad7950178e3675.tar.gz
mpd-f225051348750cb9c2cf7ae632ad7950178e3675.tar.xz
mpd-f225051348750cb9c2cf7ae632ad7950178e3675.zip
fixed possible format_context not closed in ffmpeg_decode
Diffstat (limited to 'src')
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 66b3ec0c1..f2ad714bf 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -424,8 +424,11 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
const SampleFormat sample_format =
ffmpeg_sample_format(codec_context->sample_fmt);
- if (sample_format == SampleFormat::UNDEFINED)
+ if (sample_format == SampleFormat::UNDEFINED) {
+ // (error message already done by ffmpeg_sample_format())
+ avformat_close_input(&format_context);
return;
+ }
Error error;
AudioFormat audio_format;