[FFmpeg-cvslog] avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()

Michael Niedermayer git at videolan.org
Sun Jun 2 23:33:02 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu May 16 04:13:14 2024 +0200| [e5098589b0ca74b3f52e09bae277306a1fc0cd43] | committer: Michael Niedermayer

avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()

Helps: CID1548380 Uninitialized scalar variable

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=e5098589b0ca74b3f52e09bae277306a1fc0cd43
---

 libavcodec/rv34.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 23a570bb80..cfd4cd259a 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -98,6 +98,8 @@ static av_cold void rv34_gen_vlc_ext(const uint8_t *bits, int size, VLC *vlc,
     uint16_t cw[MAX_VLC_SIZE];
     int maxbits;
 
+    av_assert1(size > 0);
+
     for (int i = 0; i < size; i++)
         counts[bits[i]]++;
 



More information about the ffmpeg-cvslog mailing list