diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-25 06:07:37 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-03-30 12:36:32 +0200 |
commit | e48f18e2d5e492ef41139d55a3698044fc245eca (patch) | |
tree | fed0189307aa3cecc67ba495fe3127dfe6f346db /libavcodec/vorbisenc.c | |
parent | ddd0f5dbe9ff0542ba9438e593c31284635b412f (diff) |
avcodec/vorbisenc, wmavoice: Use put_bits_left() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/vorbisenc.c')
-rw-r--r-- | libavcodec/vorbisenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index f8a08f816f..080017e2bf 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -155,7 +155,7 @@ static inline int put_codeword(PutBitContext *pb, vorbis_enc_codebook *cb, av_assert2(entry >= 0); av_assert2(entry < cb->nentries); av_assert2(cb->lens[entry]); - if (pb->size_in_bits - put_bits_count(pb) < cb->lens[entry]) + if (put_bits_left(pb) < cb->lens[entry]) return AVERROR(EINVAL); put_bits(pb, cb->lens[entry], cb->codewords[entry]); return 0; @@ -798,7 +798,7 @@ static int floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc, int coded[MAX_FLOOR_VALUES]; // first 2 values are unused int i, counter; - if (pb->size_in_bits - put_bits_count(pb) < 1 + 2 * ilog(range - 1)) + if (put_bits_left(pb) < 1 + 2 * ilog(range - 1)) return AVERROR(EINVAL); put_bits(pb, 1, 1); // non zero put_bits(pb, ilog(range - 1), posts[0]); |