[FFmpeg-devel] [PATCH v1] avcodec/libvpxenc: fix potential memory leak.

James Zern jzern at google.com
Wed Feb 17 04:10:01 EET 2021


On Tue, Feb 16, 2021 at 4:17 PM Wonkap Jang
<wonkap-at-google.com at ffmpeg.org> wrote:
>
> On Tue, Feb 16, 2021 at 1:02 PM James Zern <jzern-at-google.com at ffmpeg.org>
> wrote:
> [...]
> >
> > >
> > >                      while ((en2 =
> > av_dict_get(ctx->vpx_ref_frame_config, "", en2, AV_DICT_IGNORE_SUFFIX))) {
> > > @@ -1604,6 +1605,8 @@ static int vpx_encode(AVCodecContext *avctx,
> > AVPacket *pkt,
> > >                                     en2->key, en2->value);
> > >                      }
> > >
> > > +                    if (ctx->vpx_ref_frame_config)
> >
> > This check is unnecessary.
> >
> [WJ] if parsing failed at first try without allocating anything? I saw
> examples checking for it.
>

The call checks the validity of the pointer, though
libavutil/tests/dict.c doesn't look to explicitly test that condition.


More information about the ffmpeg-devel mailing list