[FFmpeg-devel] [PATCH] avfilter/vf_shufflepixels: Check ff_get_video_buffer()

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Jul 22 11:04:41 EEST 2021


There would be a segfault in case of (likely memory allocation) failure.
Fixes Coverity issue #1322338.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/vf_shufflepixels.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_shufflepixels.c b/libavfilter/vf_shufflepixels.c
index b404eefe66..b5e757c929 100644
--- a/libavfilter/vf_shufflepixels.c
+++ b/libavfilter/vf_shufflepixels.c
@@ -377,6 +377,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     ThreadData td;
     int ret;
 
+    if (!out) {
+        ret = AVERROR(ENOMEM);
+        goto fail;
+    }
+
     ret = av_frame_copy_props(out, in);
     if (ret < 0) {
         av_frame_free(&out);
-- 
2.30.2



More information about the ffmpeg-devel mailing list