Commit 46c50b17 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2b1fc562
...@@ -284,7 +284,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) ...@@ -284,7 +284,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
) )
break; 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){ if(pad->needs_copy){
av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n"); av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
avfilter_unref_buffer(outpicref); avfilter_unref_buffer(outpicref);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment