Skip to content

Commit

Permalink
Fix segfault in libav_streamer destructor (resolves #59) (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabailey authored and jihoonl committed Feb 26, 2018
1 parent c3d27c1 commit 3441527
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libav_streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ LibavStreamer::~LibavStreamer()
}
if (io_buffer_)
delete io_buffer_;
if (format_context_->pb)
av_free(format_context_->pb);
if (format_context_)
if (format_context_) {
if (format_context_->pb)
av_free(format_context_->pb);
avformat_free_context(format_context_);
}
if (sws_context_)
sws_freeContext(sws_context_);
}
Expand Down

0 comments on commit 3441527

Please sign in to comment.