avcodec/vlc: Make assert check more strict

The earlier code allowed callers to use arbitrary values as
symbols_size as long as no symbols were present.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-10-03 15:19:06 +02:00
parent ef58de7fdc
commit 5d0e8fa4bb

View file

@ -260,7 +260,7 @@ int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes,
if (ret < 0)
return ret;
av_assert0(symbols_size <= 2 || !symbols);
av_assert0(symbols_size <= 2U);
j = 0;
#define COPY(condition)\
for (int i = 0; i < nb_codes; i++) { \