mirror of
https://github.com/alexkay/spek.git
synced 2025-04-17 00:52:20 +03:00
Fix a memory leak
This commit is contained in:
parent
8c68b3f53d
commit
e71dba7c88
2
.gitignore
vendored
2
.gitignore
vendored
@ -38,11 +38,9 @@ po/*.gmo
|
||||
po/.intltool-merge-cache
|
||||
po/POTFILES
|
||||
po/stamp-it
|
||||
samples/
|
||||
src/*.stamp
|
||||
src/spek
|
||||
stamp-h1
|
||||
tests/test
|
||||
tests/test-utils
|
||||
web/version
|
||||
xmldocs.make
|
||||
|
@ -222,6 +222,12 @@ AudioFileImpl::~AudioFileImpl()
|
||||
av_free_packet(&this->packet);
|
||||
}
|
||||
if (this->format_context) {
|
||||
if (this->audio_stream >= 0) {
|
||||
auto codec_context = this->format_context->streams[this->audio_stream]->codec;
|
||||
if (codec_context) {
|
||||
avcodec_close(codec_context);
|
||||
}
|
||||
}
|
||||
avformat_close_input(&this->format_context);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user