[FFmpeg-cvslog] avcodec/vvc/dec: Check init_get_bits8() for failure

Michael Niedermayer git at videolan.org
Wed May 22 23:16:15 EEST 2024


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Sun May 19 01:21:37 2024 +0200| [b27c156c155887c2a0db6180162513d3a627e929] | committer: Michael Niedermayer

avcodec/vvc/dec: Check init_get_bits8() for failure

Fixes: CID1560042 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Nuo Mi <nuomi2021 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 4a8506c794d92744514aac26ac9a1b898a7401ab)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b27c156c155887c2a0db6180162513d3a627e929
---

 libavcodec/vvc/vvcdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
index 2f8b84f63b..c29d59a330 100644
--- a/libavcodec/vvc/vvcdec.c
+++ b/libavcodec/vvc/vvcdec.c
@@ -511,6 +511,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);
@@ -520,7 +521,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;



More information about the ffmpeg-cvslog mailing list