diff mbox series

[FFmpeg-devel,3/3] avfilter/vf_guided: Don't needlessly copy properties, fix potential NPD

Message ID HE1PR0301MB2154990D14DC8A79A91043B38F509@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit a0ab83bf93c546c215be1f34becb90263c11632d
Headers show
Series [FFmpeg-devel,1/3] avfilter/vf_guided: Don't free frame we don't own | expand


Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 14, 2021, 10:18 a.m. UTC
ref_frame is owned by the framesync structure and should therefore not
be modified; furthermore, these properties that are copied don't seem to
be used at all, so copying is unnecessary. Finally copying when the
destination frame is NULL gives a guaranteed segfault.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavfilter/vf_guided.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series


diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index ce78507eb6..35c518320c 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -333,10 +333,6 @@  static int process_frame(FFFrameSync *fs)
     av_frame_copy_props(out_frame, main_frame);
-    if (ctx->is_disabled || !ref_frame) {
-        av_frame_copy_props(ref_frame, main_frame);
-    }
     for (int plane = 0; plane < s->nb_planes; plane++) {
         if (!(s->planes & (1 << plane))) {
             av_image_copy_plane(out_frame->data[plane], out_frame->linesize[plane],