[FFmpeg-devel] [PATCH 3/3] Make avfilter_start_frame() invoke avfilter_get_video_buffer() on the link rather than use avfilter_default_get_video_buffer().

Stefano Sabatini stefano.sabatini-lala
Sat Aug 21 00:50:26 CEST 2010


This is required as the buffer requested may be greater than the
buffer allocated locally by avfilter_default_get_video_buffer(), for
example if in filterchain there is a pad filter.

In that case the pad filter will try to write beyond the data of the
allocated buffer, resulting in a crash.
---
 libavfilter/avfilter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 82f30b6..bc8c67e 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -330,7 +330,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
                 picref->perms,
                 link_dpad(link).min_perms, link_dpad(link).rej_perms);
 
-        link->cur_buf = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
+        link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
         link->src_buf = picref;
         avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
     }
-- 
1.7.1




More information about the ffmpeg-devel mailing list