[FFmpeg-cvslog] vf_pad: check that we have write permission before writing in the buffer.

Michael Niedermayer git at videolan.org
Sat Jun 16 02:00:42 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 16 01:54:11 2012 +0200| [46c50b1726b27604f05511f7661e1e40e891a0e5] | committer: Michael Niedermayer

vf_pad: check that we have write permission before writing in the buffer.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46c50b1726b27604f05511f7661e1e40e891a0e5
---

 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 413fde1..08a1f8e 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -284,7 +284,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
           )
             break;
     }
-    pad->needs_copy= plane < 4 && outpicref->data[plane];
+    pad->needs_copy= plane < 4 && outpicref->data[plane] || !(outpicref->perms & AV_PERM_WRITE);
     if(pad->needs_copy){
         av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
         avfilter_unref_buffer(outpicref);



More information about the ffmpeg-cvslog mailing list