Skip to content

Commit 3441527

Browse files
jabaileyjihoonl
authored andcommitted
Fix segfault in libav_streamer destructor (resolves #59) (#60)
1 parent c3d27c1 commit 3441527

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libav_streamer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ LibavStreamer::~LibavStreamer()
7777
}
7878
if (io_buffer_)
7979
delete io_buffer_;
80-
if (format_context_->pb)
81-
av_free(format_context_->pb);
82-
if (format_context_)
80+
if (format_context_) {
81+
if (format_context_->pb)
82+
av_free(format_context_->pb);
8383
avformat_free_context(format_context_);
84+
}
8485
if (sws_context_)
8586
sws_freeContext(sws_context_);
8687
}

0 commit comments

Comments
 (0)