[FFmpeg-devel] [PATCH] avfilter/vf_v360: check the limit of in_pad and out_pad

Steven Liu lq at chinaffmpeg.org
Tue Apr 21 16:35:12 EEST 2020


When i set out_pad=1 it will Segmentation fault
so i think it should check the limit value of the in_pad and out_pad

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavfilter/vf_v360.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index ebc281dfca..6aabbc11ff 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -3766,6 +3766,10 @@ static int config_output(AVFilterLink *outlink)
     int (*prepare_out)(AVFilterContext *ctx);
     int have_alpha;
 
+    if (s->out_pad == 1.0 || s->in_pad == 1.0) {
+        av_log(s, AV_LOG_ERROR, "pad should smaller than 1.0\n");
+        return AVERROR(EINVAL);
+    }
     s->max_value = (1 << depth) - 1;
     s->input_mirror_modifier[0] = s->ih_flip ? -1.f : 1.f;
     s->input_mirror_modifier[1] = s->iv_flip ? -1.f : 1.f;
-- 
2.25.0





More information about the ffmpeg-devel mailing list