diff mbox series

[FFmpeg-devel,04/12] avcodec/dvenc: Remove dead error message

Message ID 20210325154956.2405162-4-andreas.rheinhardt@gmail.com
State Accepted
Commit ddd0f5dbe9ff0542ba9438e593c31284635b412f
Headers show
Series [FFmpeg-devel,01/12] avcodec/vorbisenc: Remove always-false check | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 25, 2021, 3:49 p.m. UTC
The PutBits API checks the available space before every write,
so this check for overread is dead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/dvenc.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 233e2b68c7..134315a834 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -980,11 +980,6 @@  static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
         int size = pbs[j].size_in_bits >> 3;
         flush_put_bits(&pbs[j]);
         pos = put_bits_count(&pbs[j]) >> 3;
-        if (pos > size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "bitstream written beyond buffer size\n");
-            return -1;
-        }
         memset(pbs[j].buf + pos, 0xff, size - pos);
     }