]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/vorbisenc: Remove always-false check
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Mar 2021 23:59:42 +0000 (00:59 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 30 Mar 2021 10:36:31 +0000 (12:36 +0200)
The PutBitContext is big enough: It has just been initialized to 8192B.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/vorbisenc.c

index 18a679f2dcadd8e978092aba5b848fcd7b54b51b..f8a08f816f5be85adac8f043c850cd2f862a4f42 100644 (file)
@@ -1135,11 +1135,6 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 
     init_put_bits(&pb, avpkt->data, avpkt->size);
 
-    if (pb.size_in_bits - put_bits_count(&pb) < 1 + ilog(venc->nmodes - 1)) {
-        av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
-        return AVERROR(EINVAL);
-    }
-
     put_bits(&pb, 1, 0); // magic bit
 
     put_bits(&pb, ilog(venc->nmodes - 1), 1); // Mode for current frame