fixed possible format_context not closed in ffmpeg_decode

This commit is contained in:
geneticdrift 2014-02-07 12:54:03 +02:00 committed by Max Kellermann
parent b2e3fdef0f
commit f225051348
1 changed files with 4 additions and 1 deletions

View File

@ -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;