From ea912913de55917525c6de6a9aca337e609384fb Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 4 Aug 2011 21:46:58 +0200 Subject: Fixed segfault in ~DecderFFmpeg(). avcodec_close() should be called first, because it's connected to the format context which is also freed here by av_close_input_file(). --- decoders/ffmpeg_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'decoders') diff --git a/decoders/ffmpeg_decoder.cpp b/decoders/ffmpeg_decoder.cpp index 7b7397f..7a34724 100644 --- a/decoders/ffmpeg_decoder.cpp +++ b/decoders/ffmpeg_decoder.cpp @@ -24,8 +24,8 @@ DecoderFFmpeg::DecoderFFmpeg(const std::string& filename) { } DecoderFFmpeg::~DecoderFFmpeg() { - av_close_input_file(lavf_ctx); avcodec_close(lavc_ctx); + av_close_input_file(lavf_ctx); } std::size_t DecoderFFmpeg::read(char* buf, std::size_t buf_size) { -- cgit v1.2.3