summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-08-04 21:46:58 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-08-04 21:46:58 +0200
commitea912913de55917525c6de6a9aca337e609384fb (patch)
treec8f7fa747f1d611f607b06a45caf983c587ef32b
parent16e1e247638aa0da5541aa78fb141e60744d56a0 (diff)
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().
-rw-r--r--decoders/ffmpeg_decoder.cpp2
1 files changed, 1 insertions, 1 deletions
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) {