[FFmpeg-cvslog] avcodec/vc2enc: Actually zero padding

Andreas Rheinhardt git at videolan.org
Mon Apr 26 21:11:57 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Apr 26 18:16:24 2021 +0200| [aa2e0b868df559a17a10fc40578617bc254885b8] | committer: Andreas Rheinhardt

avcodec/vc2enc: Actually zero padding

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

Reviewed-by: Lynne <dev at lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa2e0b868df559a17a10fc40578617bc254885b8
---

 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;
 



More information about the ffmpeg-cvslog mailing list