[FFmpeg-devel] [PATCH 1/2] avcodec/vc2enc: Actually zero padding

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Apr 26 20:15:10 EEST 2021


This encoder sets the min_size in ff_alloc_packet2(), so it can not rely
on av_packet_make_refcounted() to zero the padding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/vc2enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 7bd2e4c2ab..6c2e873a23 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -993,7 +993,7 @@ static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     }
 
     flush_put_bits(&s->pb);
-    avpkt->size = put_bits_count(&s->pb) >> 3;
+    av_shrink_packet(avpkt, put_bytes_output(&s->pb));
 
     *got_packet = 1;
 
-- 
2.27.0



More information about the ffmpeg-devel mailing list