[FFmpeg-devel] [PATCH 1/5] avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()

Michael Niedermayer michael at niedermayer.cc
Fri May 17 02:19:28 EEST 2024


Helps: CID1548380 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/rv34.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 23a570bb807..4ce0cc58d05 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_assert0(size > 0);
+
     for (int i = 0; i < size; i++)
         counts[bits[i]]++;
 
-- 
2.43.2



More information about the ffmpeg-devel mailing list