1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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) if (ret < 0)
return ret; return ret;
av_assert0(symbols_size <= 2 || !symbols); av_assert0(symbols_size <= 2U);
j = 0; j = 0;
#define COPY(condition)\ #define COPY(condition)\
for (int i = 0; i < nb_codes; i++) { \ for (int i = 0; i < nb_codes; i++) { \