Skip to content

Commit a5ad30e

Browse files
author
Clement Champetier
committed
Video/Audio frames: fix seg fault when process a graph of filters
We should unref the frames before delete their data.
1 parent 9203a71 commit a5ad30e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/AvTranscoder/data/decoded/AudioFrame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ std::string AudioFrame::getChannelLayoutDesc() const
6363

6464
AudioFrame::~AudioFrame()
6565
{
66+
if(_frame->buf[0])
67+
av_frame_unref(_frame);
6668
if(_dataAllocated)
6769
freeData();
6870
}

src/AvTranscoder/data/decoded/VideoFrame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ VideoFrame::VideoFrame(const VideoFrameDesc& desc, const bool forceDataAllocatio
5959

6060
VideoFrame::~VideoFrame()
6161
{
62+
if(_frame->buf[0])
63+
av_frame_unref(_frame);
6264
if(_dataAllocated)
6365
freeData();
6466
}

0 commit comments

Comments
 (0)