[FFmpeg-cvslog] avfilter/vf_blend: fix un-checked potential memory allocation failure

Wu Jianhua git at videolan.org
Wed Jan 5 16:17:54 EET 2022


ffmpeg | branch: master | Wu Jianhua <jianhua.wu at intel.com> | Sat Jan  1 03:17:09 2022 +0800| [49250b582ad109e04efd029cdb96020ef54fc2ee] | committer: Lynne

avfilter/vf_blend: fix un-checked potential memory allocation failure

Signed-off-by: Wu Jianhua <jianhua.wu at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49250b582ad109e04efd029cdb96020ef54fc2ee
---

 libavfilter/vf_blend.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index b6f3c4fed3..2d433e439f 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -279,7 +279,11 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
     dst_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     if (!dst_buf)
         return top_buf;
-    av_frame_copy_props(dst_buf, top_buf);
+
+    if (av_frame_copy_props(dst_buf, top_buf) < 0) {
+        av_frame_free(&dst_buf);
+        return top_buf;
+    }
 
     for (plane = 0; plane < s->nb_planes; plane++) {
         int hsub = plane == 1 || plane == 2 ? s->hsub : 0;



More information about the ffmpeg-cvslog mailing list