[FFmpeg-cvslog] avcodec/tests/bitstream_template: Assert bits_init8() return

Michael Niedermayer git at videolan.org
Tue May 28 04:50:44 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu May 23 02:37:04 2024 +0200| [e7775973f037724f26676015a364134fd728babf] | committer: Michael Niedermayer

avcodec/tests/bitstream_template: Assert bits_init8() return

Helps: CID1518967 Unchecked return value
Helps: CID1518968 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/tests/bitstream_template.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tests/bitstream_template.c b/libavcodec/tests/bitstream_template.c
index ef59845154..b4c8821a90 100644
--- a/libavcodec/tests/bitstream_template.c
+++ b/libavcodec/tests/bitstream_template.c
@@ -61,6 +61,7 @@ int main(int argc, char **argv)
     uint64_t val, val1;
     int32_t  sval, sval1;
     unsigned count;
+    int ret;
 
     /* generate random input, using a given or random seed */
     if (argc > 1)
@@ -74,7 +75,8 @@ int main(int argc, char **argv)
     for (unsigned i = 0; i < SIZE; i++)
         buf[i] = av_lfg_get(&lfg);
 
-    bits_init8   (&bc, buf, SIZE);
+    ret = bits_init8   (&bc, buf, SIZE);
+    av_assert0(ret >= 0);
     init_put_bits(&pb, dst, SIZE);
 
     /* use a random sequence of bitreading operations to transfer data



More information about the ffmpeg-cvslog mailing list