ffmpeg | branch: release/5.1 | Michael Niedermayer <mich...@niedermayer.cc> | 
Thu May 16 04:13:14 2024 +0200| [442d18371ecd7f448ca058baff1813158ca4a135] | 
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 <mich...@niedermayer.cc>
(cherry picked from commit e5098589b0ca74b3f52e09bae277306a1fc0cd43)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

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

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

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to