[FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure

Michael Niedermayer michael at niedermayer.cc
Sun May 19 22:39:22 EEST 2024


On Sun, May 19, 2024 at 10:31:50PM +0800, Nuo Mi wrote:
> On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael at niedermayer.cc>
> wrote:
> 
> > Fixes: CID1560042 Unchecked return value
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/vvc/dec.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
> > index d262d310125..f2ede490c8b 100644
> > --- a/libavcodec/vvc/dec.c
> > +++ b/libavcodec/vvc/dec.c
> > @@ -514,6 +514,7 @@ static int slice_init_entry_points(SliceContext *sc,
> >      int nb_eps                = sh->r->num_entry_points + 1;
> >      int ctu_addr              = 0;
> >      GetBitContext gb;
> > +    int ret;
> >
> >      if (sc->nb_eps != nb_eps) {
> >          eps_free(sc);
> > @@ -523,7 +524,9 @@ static int slice_init_entry_points(SliceContext *sc,
> >          sc->nb_eps = nb_eps;
> >      }
> >
> > -    init_get_bits8(&gb, slice->data, slice->data_size);
> > +    ret = init_get_bits8(&gb, slice->data, slice->data_size);
> > +    if (ret < 0)
> > +        return ret;
> >      for (int i = 0; i < sc->nb_eps; i++)
> >      {
> >          EntryPoint *ep = sc->eps + i;
> >
> LGTM.
> Thank you, Michael.

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240519/bbb843e9/attachment.sig>


More information about the ffmpeg-devel mailing list