Skip to content

Commit

Permalink
voipstream: Fixed memory leaks in how ffmpeg is used detected by sani…
Browse files Browse the repository at this point in the history
…tizer.
  • Loading branch information
levy committed Oct 18, 2024
1 parent e5d1acf commit cdb1088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/inet/applications/voipstream/AudioOutFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ bool AudioOutFile::close()
// free the stream
avformat_free_context(oc);
oc = nullptr;

avcodec_free_context(&codecCtx);
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/inet/applications/voipstream/VoipStreamSender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ void VoipStreamSender::finish()
if (pFormatCtx) {
avformat_close_input(&pFormatCtx);
}
if (pCodecCtx)
avcodec_free_context(&pCodecCtx);
}

void VoipStreamSender::openSoundFile(const char *name)
Expand Down

0 comments on commit cdb1088

Please sign in to comment.