[FFmpeg-devel] [PATCH] Fix buffer allocation in pad filter

Andrey Turkin andrey.turkin at gmail.com
Fri Dec 25 04:55:54 CET 2015


One extra line must be allocated when adding left padding to make sure
that last line in every plane fits in the allocated buffer fully
---
 libavfilter/vf_pad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index d94ced1..555b318 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -203,7 +203,7 @@ static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
 
     AVFrame *frame = ff_get_video_buffer(inlink->dst->outputs[0],
                                          w + (s->w - s->in_w),
-                                         h + (s->h - s->in_h));
+                                         h + (s->h - s->in_h) + (s->x ? 1 : 0));
     int plane;
 
     if (!frame)
-- 
2.4.10



More information about the ffmpeg-devel mailing list