Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavfilter/vf_pad.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 9739a0fdf6..61927b654a 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -210,12 +210,16 @@ static int config_output(AVFilterLink *outlink)
static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
{
PadContext *s = inlink->dst->priv;
-
- AVFrame *frame = ff_get_video_buffer(inlink->dst->outputs[0],
- w + (s->w - s->in_w),
- h + (s->h - s->in_h) + (s->x > 0));
+ AVFrame *frame;
int plane;
+ if (s->inlink_w <= 0)
+ return NULL;
+
+ frame = ff_get_video_buffer(inlink->dst->outputs[0],
+ w + (s->w - s->in_w),
+ h + (s->h - s->in_h) + (s->x > 0));
+
if (!frame)
return NULL;