aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-05-16 04:13:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-06-02 22:29:23 +0200
commite5098589b0ca74b3f52e09bae277306a1fc0cd43 (patch)
tree956a520220071cc480e6566b92ece8ebfe3ccfe9
parent6f976db251864ad698c935130370774783bf12f4 (diff)
downloadffmpeg-e5098589b0ca74b3f52e09bae277306a1fc0cd43.tar.gz
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@niedermayer.cc>
-rw-r--r--libavcodec/rv34.c2
1 files changed, 2 insertions, 0 deletions
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]]++;