[FFmpeg-devel] [PATCH 1/5] examples/filtering_video: fix memory leak
Zhao Zhili
quinkblack at foxmail.com
Mon May 14 15:17:58 EEST 2018
From: Zhao Zhili <wantlamy at gmail.com>
---
doc/examples/filtering_video.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
index 38ff9bb..225dccc 100644
--- a/doc/examples/filtering_video.c
+++ b/doc/examples/filtering_video.c
@@ -233,6 +233,7 @@ int main(int argc, char **argv)
if (packet.stream_index == video_stream_index) {
ret = avcodec_send_packet(dec_ctx, &packet);
+ av_packet_unref(&packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n");
break;
@@ -269,8 +270,9 @@ int main(int argc, char **argv)
av_frame_unref(frame);
}
}
+ } else {
+ av_packet_unref(&packet);
}
- av_packet_unref(&packet);
}
end:
avfilter_graph_free(&filter_graph);
--
2.9.5
More information about the ffmpeg-devel
mailing list