diff mbox series

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

Message ID AM7PR03MB66604994677D574F2E7CC6E78FE49@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit c4042fc1e3c3b43630c601d3b8c9ea8fc7381f1f
Headers show
Series [FFmpeg-devel] avfilter/vf_shufflepixels: Check ff_get_video_buffer()
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt July 22, 2021, 8:04 a.m. UTC
There would be a segfault in case of (likely memory allocation) failure.
Fixes Coverity issue #1322338.

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

Comments

Paul B Mahol July 22, 2021, 4:37 p.m. UTC | #1
LGTM
diff mbox series

Patch

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);