[FFmpeg-devel] [PATCH 2/2] avformat/avisynth: make sure framedata variable is initialized

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Feb 20 00:45:24 EET 2022


Stephen Hutchinson:
> Addresses Coverity issue 1500290
> 
> Signed-off-by: Stephen Hutchinson <qyot27 at gmail.com>
> ---
>  libavformat/avisynth.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
> index 03489f180f..cfb7b2a783 100644
> --- a/libavformat/avisynth.c
> +++ b/libavformat/avisynth.c
> @@ -244,7 +244,8 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
>      AviSynthContext *avs = s->priv_data;
>      const AVS_Map *avsmap;
>      AVS_VideoFrame *frame;
> -    int framedata, error;
> +    int framedata = 0;
> +    int error;
>      int planar = 0; // 0: packed, 1: YUV, 2: Y8, 3: Planar RGB, 4: YUVA, 5: Planar RGBA
>  
>      st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;

Looking at the naming in
https://github.com/AviSynth/AviSynthPlus/blob/master/avs_core/core/avisynth_c.cpp#L828
makes me believe that this variable is actually a frame number. If so,
it is misnamed and this could be fixed easily by just removing this
variable. Am I right?

- Andreas


More information about the ffmpeg-devel mailing list