1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-28 15:19:38 +03:00
Files
ffmpeg/libavfilter/vf_null.c
Michael Niedermayer f2bf7a2440 avfilter: reject frames whose size or format changed after the graph was configured
libavfilter does not reconfigure a filter when the frames on its input
change size or format after the graph was configured; a scale filter
with eval=frame nevertheless rewrites its outlink per frame, and with
-reinit_filter 0 the ffmpeg tool feeds changed frames into the graph.
Most filters size their buffers from the link at configuration time
and then overrun them.

ff_filter_frame() now rejects a frame that differs from the format and
size ff_filter_config_links() recorded for its link, unless the filter
declares with FF_FILTER_FLAG_DYNAMIC_FRAME_PARAMS that it handles such
frames. The flag replaces the list of filter names exempt from the
consistency assertion. idet is not carried over, it reads across
frames of different sizes.

Fixes: out of array write
Fixes: RqgTntCAW2qN
Found-by: mzfr
Replicated through UnModified FFmpeg

The out of array reads in idet (frames of different sizes) and showinfo
(a smaller frame with -reinit_filter 0) were found during triage of
the same report.
2026-10-12 00:42:48 +00:00

37 lines
1.2 KiB
C

/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* null video filter
*/
#include "libavutil/internal.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"
const FFFilter ff_vf_null = {
.p.name = "null",
.p.description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."),
.p.flags = AVFILTER_FLAG_METADATA_ONLY,
FILTER_INPUTS(ff_video_default_filterpad),
FILTER_OUTPUTS(ff_video_default_filterpad),
.flags_internal = FF_FILTER_FLAG_DYNAMIC_FRAME_PARAMS,
};