Skip to content

Commit 72e6d5b

Browse files
author
Clement Champetier
committed
FilterGraph: fixed memory deallocation
refFrame method allocates new data that will be freed by calling clear method or the destructor of the referenced frame.
1 parent 19663c3 commit 72e6d5b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/AvTranscoder/data/decoded/Frame.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class AvExport Frame
6464

6565
/**
6666
* @brief Copy frame properties and create a new reference to data of the given frame.
67-
* @warning This method allocates new data that will be freed only by calling the destructor of the referenced frame.
67+
* @warning This method allocates new data that will be freed by calling clear method or the destructor of the referenced frame.
68+
* @see clear
6869
*/
6970
void refFrame(const Frame& otherFrame);
7071

src/AvTranscoder/filter/FilterGraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void FilterGraph::process(const std::vector<Frame*>& inputs, Frame& output)
4040
if(!hasFilters())
4141
{
4242
LOG_DEBUG("No filter to process: reference first input frame to the given output.")
43+
output.clear();
4344
output.refFrame(*inputs.at(0));
4445
return;
4546
}

0 commit comments

Comments
 (0)